From d4407f23071f07c5a45f4ed4e8dae10f93f71691 Mon Sep 17 00:00:00 2001 From: Jeff Reiffers Date: Fri, 22 Nov 2024 14:27:56 +0100 Subject: [PATCH] fix: use fdkId as key to make sure all events of the same resource are stored in the same partition --- .../digdir/fdk/mqa/dcatvalidator/kafka/KafkaMqaEventProducer.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/no/digdir/fdk/mqa/dcatvalidator/kafka/KafkaMqaEventProducer.kt b/src/main/kotlin/no/digdir/fdk/mqa/dcatvalidator/kafka/KafkaMqaEventProducer.kt index ed11f1d..f33a37a 100644 --- a/src/main/kotlin/no/digdir/fdk/mqa/dcatvalidator/kafka/KafkaMqaEventProducer.kt +++ b/src/main/kotlin/no/digdir/fdk/mqa/dcatvalidator/kafka/KafkaMqaEventProducer.kt @@ -13,7 +13,7 @@ class KafkaMqaEventProducer( private val kafkaTemplate: KafkaTemplate ) { fun sendMQAEvent(mqaEvent: MQAEvent) { - kafkaTemplate.send("mqa-events", mqaEvent).handle { result, exception -> + kafkaTemplate.send("mqa-events", mqaEvent.fdkId.toString(), mqaEvent).handle { result, exception -> if (exception != null) { LOGGER.error("Error sending MQA event: " + exception.message) Metrics.counter("produced_messages", "status", "error").increment()