From b147298fa114c4758947fe99ff61b9cbc30a919d Mon Sep 17 00:00:00 2001 From: Dinh Anh Tuan Tran Date: Thu, 3 Aug 2023 12:04:16 +0200 Subject: [PATCH] added a log to easily see what kafka rapid is doing --- hm-rapids-and-rivers-v2-micronaut/build.gradle.kts | 2 +- .../no/nav/hm/rapids_rivers/micronaut/RapidsRiversFactory.kt | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/hm-rapids-and-rivers-v2-micronaut/build.gradle.kts b/hm-rapids-and-rivers-v2-micronaut/build.gradle.kts index fc27a40..25546e4 100644 --- a/hm-rapids-and-rivers-v2-micronaut/build.gradle.kts +++ b/hm-rapids-and-rivers-v2-micronaut/build.gradle.kts @@ -11,7 +11,7 @@ dependencies { implementation(project(":hm-rapids-and-rivers-v2-core")) runtimeOnly("org.yaml:snakeyaml") implementation("io.micronaut:micronaut-jackson-databind") - + kapt("io.micronaut:micronaut-inject") implementation("io.micronaut:micronaut-runtime") implementation("io.micronaut.kotlin:micronaut-kotlin-runtime") testImplementation("io.micronaut.test:micronaut-test-junit5") diff --git a/hm-rapids-and-rivers-v2-micronaut/src/main/kotlin/no/nav/hm/rapids_rivers/micronaut/RapidsRiversFactory.kt b/hm-rapids-and-rivers-v2-micronaut/src/main/kotlin/no/nav/hm/rapids_rivers/micronaut/RapidsRiversFactory.kt index 1ba9150..89cfdcf 100644 --- a/hm-rapids-and-rivers-v2-micronaut/src/main/kotlin/no/nav/hm/rapids_rivers/micronaut/RapidsRiversFactory.kt +++ b/hm-rapids-and-rivers-v2-micronaut/src/main/kotlin/no/nav/hm/rapids_rivers/micronaut/RapidsRiversFactory.kt @@ -10,13 +10,18 @@ import jakarta.inject.Singleton import no.nav.helse.rapids_rivers.KafkaConfig import no.nav.helse.rapids_rivers.KafkaRapid import no.nav.helse.rapids_rivers.KafkaRapidMetrics +import org.slf4j.LoggerFactory @Factory @Requires(property = "rapidsandrivers.enabled", notEquals="false", defaultValue = "true") class RapidsRiversFactory { + companion object { + private val LOG = LoggerFactory.getLogger(RapidsRiversFactory::class.java) + } @Singleton fun createKafkaRapid(kafkaProps: KafkaProperties): KafkaRapid { + LOG.info("Creating kafka rapid service with bootstrap server to: ${kafkaProps.brokers}") val kafkaConfig = KafkaConfig( bootstrapServers =kafkaProps.brokers, consumerGroupId = kafkaProps.consumerGroupId,