WIP
authorKai Moritz <kai@juplo.de>
Wed, 24 Jan 2024 21:46:32 +0000 (22:46 +0100)
committerKai Moritz <kai@juplo.de>
Wed, 24 Jan 2024 21:46:32 +0000 (22:46 +0100)
src/main/java/de/juplo/kafka/SimpleProducer.java
src/test/java/de/juplo/kafka/ApplicationTests.java

index 2b5b441..b9e8152 100644 (file)
@@ -33,6 +33,7 @@ public class SimpleProducer
     this.id = clientId;
     this.topic = topic;
     producer = new KafkaProducer<>(props);
+    producer.initTransactions();
   }
 
   public void run()
index bfb665f..d72ddfb 100644 (file)
@@ -16,7 +16,12 @@ import static org.awaitility.Awaitility.*;
 
 
 @ExtendWith(SpringExtension.class)
-@EmbeddedKafka(topics = TOPIC, partitions = PARTITIONS)
+@EmbeddedKafka(
+  topics = TOPIC,
+  partitions = PARTITIONS,
+  brokerProperties = {
+    "transaction.state.log.replication.factor=1",
+    "transaction.state.log.min.isr=1" })
 @Slf4j
 public class ApplicationTests
 {