diff options
Diffstat (limited to 'sources/hv-collector-health-check')
-rw-r--r-- | sources/hv-collector-health-check/pom.xml | 5 | ||||
-rw-r--r-- | sources/hv-collector-health-check/src/main/kotlin/org/onap/dcae/collectors/veshv/healthcheck/factory/HealthCheckApiServer.kt | 9 |
2 files changed, 5 insertions, 9 deletions
diff --git a/sources/hv-collector-health-check/pom.xml b/sources/hv-collector-health-check/pom.xml index 68915939..90ec958d 100644 --- a/sources/hv-collector-health-check/pom.xml +++ b/sources/hv-collector-health-check/pom.xml @@ -49,15 +49,10 @@ <artifactId>reactor-netty</artifactId> </dependency> <dependency> - <groupId>io.arrow-kt</groupId> - <artifactId>arrow-effects</artifactId> - </dependency> - <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> <scope>test</scope> </dependency> - <dependency> <groupId>org.jetbrains.kotlin</groupId> <artifactId>kotlin-test</artifactId> diff --git a/sources/hv-collector-health-check/src/main/kotlin/org/onap/dcae/collectors/veshv/healthcheck/factory/HealthCheckApiServer.kt b/sources/hv-collector-health-check/src/main/kotlin/org/onap/dcae/collectors/veshv/healthcheck/factory/HealthCheckApiServer.kt index fb5bb9a2..cff8160c 100644 --- a/sources/hv-collector-health-check/src/main/kotlin/org/onap/dcae/collectors/veshv/healthcheck/factory/HealthCheckApiServer.kt +++ b/sources/hv-collector-health-check/src/main/kotlin/org/onap/dcae/collectors/veshv/healthcheck/factory/HealthCheckApiServer.kt @@ -19,7 +19,6 @@ */ package org.onap.dcae.collectors.veshv.healthcheck.factory -import arrow.effects.IO import io.netty.handler.codec.http.HttpResponseStatus import org.onap.dcae.collectors.veshv.healthcheck.api.HealthDescription import org.onap.dcae.collectors.veshv.healthcheck.api.HealthState @@ -45,9 +44,9 @@ class HealthCheckApiServer(private val healthState: HealthState, private val healthDescription: AtomicReference<HealthDescription> = AtomicReference(HealthDescription.STARTING) - fun start(): IO<ServerHandle> = IO { + fun start(): Mono<ServerHandle> = Mono.defer { healthState().subscribe(healthDescription::set) - val ctx = HttpServer.create() + HttpServer.create() .tcpConfiguration { it.addressSupplier { listenAddress } .doOnUnbound { logClose() } @@ -57,7 +56,9 @@ class HealthCheckApiServer(private val healthState: HealthState, routes.get("/health/alive", ::livenessHandler) routes.get("/monitoring/prometheus", ::monitoringHandler) } - NettyServerHandle(ctx.bindNow()) + .bind() + .map { NettyServerHandle(it) } + } private fun readinessHandler(_req: HttpServerRequest, resp: HttpServerResponse) = |