File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
newm-server/src/main/kotlin/io/newm/server/curator Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 11package io.newm.server.curator
22
3+ import io.github.oshai.kotlinlogging.KotlinLogging
34import io.ktor.server.application.Application
45import io.ktor.server.application.install
56import io.newm.server.curator.support.CuratorPlugin
67import io.newm.shared.ktx.getBoolean
78import io.newm.shared.ktx.getConfigChild
89import io.newm.shared.ktx.getInt
910import io.newm.shared.ktx.getString
11+ import kotlin.io.path.Path
12+ import kotlin.io.path.readText
1013import org.apache.curator.ensemble.fixed.FixedEnsembleProvider
1114import org.apache.curator.retry.ExponentialBackoffRetry
1215
1316fun Application.installCurator () {
17+ val log = KotlinLogging .logger { }
1418 val config = environment.getConfigChild(" curator" )
1519 if (config.getBoolean(" enabled" )) {
1620 install(CuratorPlugin ) {
1721 ensembleProvider(
18- FixedEnsembleProvider (config.getString(" connectionString" ), false ),
22+ FixedEnsembleProvider (
23+ config.getString(" connectionString" ).also { connectionString ->
24+ log.info {
25+ " Using Zookeeper connection string: '$connectionString ', contents: ${
26+ Path (
27+ connectionString
28+ ).readText()
29+ } "
30+ }
31+ },
32+ false
33+ ),
1934 )
2035 retryPolicy(ExponentialBackoffRetry (config.getInt(" baseSleepTime" ), config.getInt(" maxRetries" )))
2136 }
You can’t perform that action at this time.
0 commit comments