`buffer.memory` konfigurierbar gemacht producer/spring-producer producer/spring-producer--2024-11-13--si
authorKai Moritz <kai@juplo.de>
Sun, 3 Nov 2024 10:23:15 +0000 (11:23 +0100)
committerKai Moritz <kai@juplo.de>
Fri, 8 Nov 2024 17:07:12 +0000 (18:07 +0100)
src/main/java/de/juplo/kafka/ApplicationConfiguration.java
src/main/java/de/juplo/kafka/ApplicationProperties.java
src/main/resources/application.yml

index 3666233..7540dd3 100644 (file)
@@ -42,6 +42,7 @@ public class ApplicationConfiguration
     props.put("acks", properties.getProducerProperties().getAcks());
     props.put("delivery.timeout.ms", (int)properties.getProducerProperties().getDeliveryTimeout().toMillis());
     props.put("max.block.ms", (int)properties.getProducerProperties().getMaxBlock().toMillis());
+    props.put("buffer.memory", properties.getProducerProperties().getBufferMemory());
     props.put("batch.size", properties.getProducerProperties().getBatchSize());
     props.put("metadata.max.age.ms",  5000); //  5 Sekunden
     props.put("request.timeout.ms",   5000); //  5 Sekunden
index 594fa28..4323262 100644 (file)
@@ -49,6 +49,8 @@ public class ApplicationProperties
     @NotNull
     private Duration maxBlock;
     @NotNull
+    private Long bufferMemory;
+    @NotNull
     private Integer batchSize;
     @NotNull
     private Duration linger;
index 4c6519d..98ea128 100644 (file)
@@ -6,6 +6,7 @@ juplo:
     acks: -1
     delivery-timeout: 10s
     max-block: 5s
+    buffer-memory: 33554432
     batch-size: 16384
     linger: 0
     compression-type: gzip
@@ -32,6 +33,7 @@ info:
       acks: ${juplo.producer.acks}
       delivery-timeout: ${juplo.producer.delivery-timeout}
       max-block: ${juplo.producer.max-block}
+      buffer-memory: ${juplo.producer.buffer-memory}
       batch-size: ${juplo.producer.batch-size}
       linger: ${juplo.producer.linger}
       compression-type: ${juplo.producer.compression-type}