summaryrefslogtreecommitdiffstats
path: root/sources/hv-collector-health-check
diff options
context:
space:
mode:
authorPiotr Jaszczyk <piotr.jaszczyk@nokia.com>2019-04-03 15:07:22 +0200
committerPiotr Jaszczyk <piotr.jaszczyk@nokia.com>2019-04-04 12:57:15 +0200
commitc775e8677cdbf69f2b1c1390d225329c658c0ee2 (patch)
tree707456ffe0817ed2d29d9a62ccf98b9d267283ba /sources/hv-collector-health-check
parentc7a3e0738abf581640059587dbb81790339340c9 (diff)
Get rid of arrow-effects usage
Also clean-up dependencies + use Kotlin BOM to force single kotlin-stdlib on classpath. Issue-ID: DCAEGEN2-1392 Change-Id: I447c4686707de81f35f7734255ce0b13c997c4a4 Signed-off-by: Piotr Jaszczyk <piotr.jaszczyk@nokia.com>
Diffstat (limited to 'sources/hv-collector-health-check')
-rw-r--r--sources/hv-collector-health-check/pom.xml5
-rw-r--r--sources/hv-collector-health-check/src/main/kotlin/org/onap/dcae/collectors/veshv/healthcheck/factory/HealthCheckApiServer.kt9
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) =