`fetch.max.wait` konfigurierbar gemacht
authorKai Moritz <kai@juplo.de>
Thu, 26 Dec 2024 10:46:02 +0000 (11:46 +0100)
committerKai Moritz <kai@juplo.de>
Thu, 6 Feb 2025 17:04:39 +0000 (18:04 +0100)
src/main/java/de/juplo/kafka/ApplicationConfiguration.java
src/main/java/de/juplo/kafka/ApplicationProperties.java
src/main/resources/application.yml

index 619e44c..6e920c1 100644 (file)
@@ -79,6 +79,7 @@ public class ApplicationConfiguration
     props.put("metadata.maxage.ms", 5000); //  5 Sekunden
     props.put("max.poll.interval.ms", (int) properties.getConsumer().getMaxPollInterval().toMillis());
     props.put("max.poll.interval.records", properties.getConsumer().getMaxPollRecords());
+    props.put("fetch.max.wait.ms", (int)properties.getConsumer().getFetchMaxWait().toMillis());
     props.put("partition.assignment.strategy", StickyAssignor.class.getName());
     props.put("key.deserializer", StringDeserializer.class.getName());
     props.put("value.deserializer", LongDeserializer.class.getName());
index ed8f23a..b84c2d2 100644 (file)
@@ -54,6 +54,8 @@ public class ApplicationProperties
     @NotNull
     private int maxPollRecords;
     @NotNull
+    private Duration fetchMaxWait;
+    @NotNull
     private Duration maxTimePerRecord;
     @NotNull
     private Duration minSlackPerPollInterval;
index 554d632..6528b28 100644 (file)
@@ -9,6 +9,7 @@ juplo:
     poll-request-timeout: 1s
     max-poll-interval: 5m
     max-poll-records: 500
+    fetch-max-wait: 500ms
     max-time-per-record: 30s
     min-slack-per-poll-interval: 1s
     num-retries: 10