From ac0f73ea8d046e2f3caefb14aad9d2f090be5850 Mon Sep 17 00:00:00 2001 From: Thomas Burnett Date: Thu, 14 Sep 2023 09:34:53 +0200 Subject: [PATCH] Payload healthchecks og toString i test endepunkt --- .nais/payload-processor-dev.yaml | 12 ++++++++++++ .../src/main/kotlin/no/nav/emottak/App.kt | 2 +- .../src/main/kotlin/no/nav/emottak/HealthRouting.kt | 4 ++-- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.nais/payload-processor-dev.yaml b/.nais/payload-processor-dev.yaml index d24956bb..6e06fb07 100644 --- a/.nais/payload-processor-dev.yaml +++ b/.nais/payload-processor-dev.yaml @@ -7,6 +7,18 @@ metadata: "team": "team-emottak" spec: image: {{image}} + liveness: + path: "/internal/health/liveness" + port: 8080 + initialDelay: 30 + timeout: 10 + failureThreshold: 10 + readiness: + path: "/internal/health/readiness" + port: 8080 + initialDelay: 30 + timeout: 10 + failureThreshold: 10 replicas: min: 1 max: 1 diff --git a/payload-processor/src/main/kotlin/no/nav/emottak/App.kt b/payload-processor/src/main/kotlin/no/nav/emottak/App.kt index d50b2ab5..a3045e2b 100644 --- a/payload-processor/src/main/kotlin/no/nav/emottak/App.kt +++ b/payload-processor/src/main/kotlin/no/nav/emottak/App.kt @@ -63,7 +63,7 @@ private fun Application.serverSetup() { processedPayload = testByteArray ) val prosessertMelding = processor.processOutgoing(melding) - call.respondText(prosessertMelding.header.messageId) + call.respondText(prosessertMelding.toString()) } post("/payload") { diff --git a/payload-processor/src/main/kotlin/no/nav/emottak/HealthRouting.kt b/payload-processor/src/main/kotlin/no/nav/emottak/HealthRouting.kt index 6f9f9c9c..8b5a4cd4 100644 --- a/payload-processor/src/main/kotlin/no/nav/emottak/HealthRouting.kt +++ b/payload-processor/src/main/kotlin/no/nav/emottak/HealthRouting.kt @@ -12,10 +12,10 @@ import io.prometheus.client.exporter.common.TextFormat fun Routing.registerHealthEndpoints( collectorRegistry: CollectorRegistry = CollectorRegistry.defaultRegistry, ) { - get("/alive") { + get("/internal/health/liveness") { call.respondText("I'm alive! :)") } - get("/ready") { + get("/internal/health/readiness") { call.respondText("I'm ready! :)") } get("/prometheus") {