From 41ed359f532011ff9b1ee7839132a07a93cc8fb6 Mon Sep 17 00:00:00 2001 From: Oleksandr Chmyr Date: Mon, 16 Dec 2024 15:14:45 +0100 Subject: [PATCH] Fjernet "read" tilgang til Kafka for ebms-provider --- .nais/kafka/kafka-dev.yaml | 2 +- .../main/kotlin/no/nav/emottak/ebms/App.kt | 21 ------------------- 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/.nais/kafka/kafka-dev.yaml b/.nais/kafka/kafka-dev.yaml index 37b33fbe..d3a90664 100644 --- a/.nais/kafka/kafka-dev.yaml +++ b/.nais/kafka/kafka-dev.yaml @@ -17,6 +17,6 @@ spec: retentionHours: 168 segmentHours: 168 acl: - - access: readwrite + - access: write application: ebms-provider team: team-emottak diff --git a/ebms-provider/src/main/kotlin/no/nav/emottak/ebms/App.kt b/ebms-provider/src/main/kotlin/no/nav/emottak/ebms/App.kt index 824f8a40..70e332c2 100644 --- a/ebms-provider/src/main/kotlin/no/nav/emottak/ebms/App.kt +++ b/ebms-provider/src/main/kotlin/no/nav/emottak/ebms/App.kt @@ -73,27 +73,6 @@ fun Application.ebmsProviderModule() { get("/") { call.respondText("Hello, world!") } - get("/kafkatest_read") { - log.debug("Kafka test read: start") - - val consumer = kafkaClientObject.createConsumer() - val topic = getEnvVar("KAFKA_TOPIC_ACKNOWLEDGMENTS", "team-emottak.smtp.out.ebxml.signal") - - consumer.subscribe(listOf(topic)) - - try { - val records = consumer.poll(Duration.ofMillis(10000)).onEach { - log.debug("Kafka test read: Message read successfully: ${it.value()}") - } - log.debug("Kafka test read: Messages read - ${records.count()}") - } catch (e: Exception) { - log.error("Kafka test read: Exception while reading messages from queue", e) - } finally { - consumer.unsubscribe() - consumer.close() - } - call.respondText("Kafka works!") - } get("/kafkatest_write") { log.debug("Kafka test write: start")