From 5c0b7b3cf822c0802c3d802a47934b6304eaed7c Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sat, 2 Apr 2022 19:37:01 +0200 Subject: [PATCH] =?utf8?q?Der=20Producer=20erkennt=20die=20=C3=84nderung?= =?utf8?q?=20der=20Partitionierung=20schneller?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * `metadata.max.age.ms` auf 1000 heruntergesetzt (Default 5 min) * Dadurch wird die Änderung der Anzahl an Partitionen zeitnah erkannt --- src/main/java/de/juplo/kafka/EndlessProducer.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/de/juplo/kafka/EndlessProducer.java b/src/main/java/de/juplo/kafka/EndlessProducer.java index 7a5b324..8b3743d 100644 --- a/src/main/java/de/juplo/kafka/EndlessProducer.java +++ b/src/main/java/de/juplo/kafka/EndlessProducer.java @@ -41,6 +41,7 @@ public class EndlessProducer implements Runnable props.put("bootstrap.servers", bootstrapServer); props.put("client.id", clientId); props.put("acks", acks); + props.put("metadata.max.age.ms", "1000"); props.put("key.serializer", StringSerializer.class.getName()); props.put("value.serializer", StringSerializer.class.getName()); -- 2.20.1