From 81cea339e4b290e4ed33f279c27d871b0b50ce6d Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Thu, 26 Dec 2024 11:46:02 +0100 Subject: [PATCH] `fetch.max.wait` konfigurierbar gemacht --- src/main/java/de/juplo/kafka/ApplicationConfiguration.java | 1 + src/main/java/de/juplo/kafka/ApplicationProperties.java | 2 ++ src/main/resources/application.yml | 1 + 3 files changed, 4 insertions(+) diff --git a/src/main/java/de/juplo/kafka/ApplicationConfiguration.java b/src/main/java/de/juplo/kafka/ApplicationConfiguration.java index 619e44c8..6e920c15 100644 --- a/src/main/java/de/juplo/kafka/ApplicationConfiguration.java +++ b/src/main/java/de/juplo/kafka/ApplicationConfiguration.java @@ -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()); diff --git a/src/main/java/de/juplo/kafka/ApplicationProperties.java b/src/main/java/de/juplo/kafka/ApplicationProperties.java index ed8f23a5..b84c2d21 100644 --- a/src/main/java/de/juplo/kafka/ApplicationProperties.java +++ b/src/main/java/de/juplo/kafka/ApplicationProperties.java @@ -54,6 +54,8 @@ public class ApplicationProperties @NotNull private int maxPollRecords; @NotNull + private Duration fetchMaxWait; + @NotNull private Duration maxTimePerRecord; @NotNull private Duration minSlackPerPollInterval; diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 554d632b..6528b284 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -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 -- 2.20.1