package Ġfi . h oll ann ik as . event shuffle . configuration ĊĊ Ċ import Ġcom . mongodb . reactiv est ream s . client . Mongo Client Ċ import Ġcom . mongodb . reactiv est ream s . client . Mongo Clients Ċ import Ġorg . springframework . beans . factory . annotation . Value Ċ import Ġorg . springframework . context . annotation . Bean Ċ import Ġorg . springframework . context . annotation . Configuration Ċ import Ġorg . springframework . data . mongodb . config . Abstract Reactive Mongo Configuration Ċ import Ġorg . springframework . data . mongodb . core . Reactive Mongo Client Factory Bean Ċ import Ġorg . springframework . data . mongodb . repository . config . Enable Reactive Mongo Repositories Ċ import Ġjava . util . logging . Logger ĊĊĊ Ċ @ Enable Reactive Mongo Repositories Ċ @ Configuration Ċ class ĠApp Configuration Ġ: ĠAbstract Reactive Mongo Configuration () Ġ{ ĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġval ĠLOG Ġ= ĠLogger . getLogger ( App Configuration :: class . java . name ) !! ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Value ("\ ${ mongo . host : localhost }") Ġlateinit Ġvar Ġmongo Host Ġ: ĠString ĊĠĠĠ Ġ@ Value ("\ ${ mongo . port : 2 7 0 1 7 }") Ġlateinit Ġvar Ġmongo Port Ġ: ĠString ĊĊĠĠĠ Ġ@ Bean ĊĠĠĠ Ġoverride Ġfun Ġreactive Mongo Client (): ĠMongo Client Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġmongo Url Ġ= Ġ" mongodb :// $ mongo Host :$ mongo Port " ĊĠĠĠĠĠĠĠ ĠLOG . info (" reactive Ġ$ mongo Url ") ĊĠĠĠĠĠĠĠ Ġreturn ĠMongo Clients . create ( mongo Url ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Bean ĊĠĠĠ Ġfun Ġmongo Client () Ġ: ĠReactive Mongo Client Factory Bean Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġmongo Url Ġ= Ġ" mongodb :// $ mongo Host :$ mongo Port " ĊĠĠĠĠĠĠĠ ĠLOG . info ( mongo Url ) ĊĠĠĠĠĠĠĠ Ġval Ġclient Factory Ġ= ĠReactive Mongo Client Factory Bean () ĊĠĠĠĠĠĠĠ Ġclient Factory . set Host ( mongo Host ) ĊĠĠĠĠĠĠĠ Ġclient Factory . set Port ( mongo Port . toInt ()) ĊĊĠĠĠĠĠĠĠ Ġreturn Ġclient Factory ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġget Database Name (): ĠString Ġ= Ġ" reactive " Ċ }