From ad1aeeeb8d883b0fc3245ed508cc63dc363448b4 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Wed, 24 Jan 2024 22:04:39 +0100 Subject: [PATCH] WIP --- pom.xml | 10 ++++++++++ src/main/java/de/juplo/kafka/SimpleProducer.java | 1 + 2 files changed, 11 insertions(+) diff --git a/pom.xml b/pom.xml index 2928676..1c6d364 100644 --- a/pom.xml +++ b/pom.xml @@ -33,6 +33,16 @@ ch.qos.logback logback-classic + + org.springframework.kafka + spring-kafka-test + test + + + org.awaitility + awaitility + test + diff --git a/src/main/java/de/juplo/kafka/SimpleProducer.java b/src/main/java/de/juplo/kafka/SimpleProducer.java index db554d7..06d28ff 100644 --- a/src/main/java/de/juplo/kafka/SimpleProducer.java +++ b/src/main/java/de/juplo/kafka/SimpleProducer.java @@ -25,6 +25,7 @@ public class SimpleProducer Properties props = new Properties(); props.put("bootstrap.servers", broker); props.put("client.id", clientId); // Nur zur Wiedererkennung + props.put("transactional.id", clientId); // Aktiviert außerdem enable.idempotence=true props.put("key.serializer", StringSerializer.class.getName()); props.put("value.serializer", StringSerializer.class.getName()); -- 2.20.1