aboutsummaryrefslogtreecommitdiffstats
path: root/sources/hv-collector-main/src
diff options
context:
space:
mode:
authorkjaniak <kornel.janiak@nokia.com>2019-03-28 10:43:59 +0100
committerKornel Janiak <kornel.janiak@nokia.com>2019-03-29 08:17:14 +0000
commit4281a12d8e892f46f5f2226ee0f8aee8b862b177 (patch)
treececcc8eb35d669afdee1d250b0b3c50ee0d9a940 /sources/hv-collector-main/src
parent4f5d73f18a7952379505a4995b6afe22acf31c11 (diff)
Read HV-VES healthcheck api port from cmd line
Change-Id: I6b4680a62512ef6ba15a0454e109b19619a997a6 Issue-ID: DCAEGEN2-1364 Signed-off-by: kjaniak <kornel.janiak@nokia.com>
Diffstat (limited to 'sources/hv-collector-main/src')
-rw-r--r--sources/hv-collector-main/src/main/kotlin/org/onap/dcae/collectors/veshv/main/main.kt5
-rw-r--r--sources/hv-collector-main/src/main/kotlin/org/onap/dcae/collectors/veshv/main/servers/HealthCheckServer.kt3
2 files changed, 4 insertions, 4 deletions
diff --git a/sources/hv-collector-main/src/main/kotlin/org/onap/dcae/collectors/veshv/main/main.kt b/sources/hv-collector-main/src/main/kotlin/org/onap/dcae/collectors/veshv/main/main.kt
index c8a3c013..059e8028 100644
--- a/sources/hv-collector-main/src/main/kotlin/org/onap/dcae/collectors/veshv/main/main.kt
+++ b/sources/hv-collector-main/src/main/kotlin/org/onap/dcae/collectors/veshv/main/main.kt
@@ -38,10 +38,11 @@ private const val VES_HV_PACKAGE = "org.onap.dcae.collectors.veshv"
private val logger = Logger("$VES_HV_PACKAGE.main")
private val hvVesServer = AtomicReference<ServerHandle>()
+private val configurationModule = ConfigurationModule()
fun main(args: Array<String>) {
- HealthCheckServer.start()
- ConfigurationModule()
+ HealthCheckServer.start(configurationModule.healthCheckPort(args))
+ configurationModule
.hvVesConfigurationUpdates(args)
.publishOn(Schedulers.single(Schedulers.elastic()))
.doOnNext(::startServer)
diff --git a/sources/hv-collector-main/src/main/kotlin/org/onap/dcae/collectors/veshv/main/servers/HealthCheckServer.kt b/sources/hv-collector-main/src/main/kotlin/org/onap/dcae/collectors/veshv/main/servers/HealthCheckServer.kt
index bc284d08..9b58dcc9 100644
--- a/sources/hv-collector-main/src/main/kotlin/org/onap/dcae/collectors/veshv/main/servers/HealthCheckServer.kt
+++ b/sources/hv-collector-main/src/main/kotlin/org/onap/dcae/collectors/veshv/main/servers/HealthCheckServer.kt
@@ -34,10 +34,9 @@ import java.net.InetSocketAddress
*/
object HealthCheckServer {
- private const val DEFAULT_HEALTHCHECK_PORT = 6060
private val logger = Logger(HealthCheckServer::class)
- fun start(port: Int = DEFAULT_HEALTHCHECK_PORT) =
+ fun start(port: Int) =
createHealthCheckServer(port)
.start()
.then(::logServerStarted)