counter: 1.1.4 - Introduced parameters for the config needed by the test counter-1.1.4
authorKai Moritz <kai@juplo.de>
Sat, 11 Feb 2023 14:38:03 +0000 (15:38 +0100)
committerKai Moritz <kai@juplo.de>
Fri, 17 Feb 2023 16:31:11 +0000 (17:31 +0100)
pom.xml
src/main/java/de/juplo/kafka/wordcount/counter/CounterApplication.java
src/main/java/de/juplo/kafka/wordcount/counter/CounterApplicationProperties.java
src/test/java/de/juplo/kafka/wordcount/counter/CounterApplicationIT.java

diff --git a/pom.xml b/pom.xml
index 1d9425d..de566c5 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -10,7 +10,7 @@
        </parent>
        <groupId>de.juplo.kafka.wordcount</groupId>
        <artifactId>counter</artifactId>
-       <version>1.1.3</version>
+       <version>1.1.4</version>
        <name>Wordcount-Counter</name>
        <description>Word-counting stream-processor of the multi-user wordcount-example</description>
        <properties>
index 6a6a78c..5fc183c 100644 (file)
@@ -35,8 +35,10 @@ public class CounterApplication
                propertyMap.put(StreamsConfig.DEFAULT_KEY_SERDE_CLASS_CONFIG, Serdes.StringSerde.class.getName());
                propertyMap.put(StreamsConfig.DEFAULT_VALUE_SERDE_CLASS_CONFIG, Serdes.StringSerde.class.getName());
                propertyMap.put(StreamsConfig.STATE_DIR_CONFIG, "target");
-               propertyMap.put(StreamsConfig.COMMIT_INTERVAL_MS_CONFIG, 0);
-               propertyMap.put(StreamsConfig.CACHE_MAX_BYTES_BUFFERING_CONFIG, 0);
+               if (properties.getCommitInterval() != null)
+                       propertyMap.put(StreamsConfig.COMMIT_INTERVAL_MS_CONFIG, properties.getCommitInterval());
+               if (properties.getCacheMaxBytes() != null)
+                       propertyMap.put(StreamsConfig.CACHE_MAX_BYTES_BUFFERING_CONFIG, properties.getCacheMaxBytes());
                propertyMap.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest");
 
                CounterStreamProcessor streamProcessor = new CounterStreamProcessor(
index 351ea18..c3ada17 100644 (file)
@@ -17,4 +17,6 @@ public class CounterApplicationProperties
   private String applicationId = "counter";
   private String inputTopic = "words";
   private String outputTopic = "countings";
+  private Integer commitInterval;
+  private Integer cacheMaxBytes;
 }
index aad79b8..0d09a76 100644 (file)
@@ -29,6 +29,8 @@ import static org.awaitility.Awaitility.*;
                properties = {
                                "spring.kafka.bootstrap-servers=${spring.embedded.kafka.brokers}",
                                "juplo.wordcount.counter.bootstrap-server=${spring.embedded.kafka.brokers}",
+                               "juplo.wordcount.counter.commit-interval=0",
+                               "juplo.wordcount.counter.cacheMaxBytes=0",
                                "juplo.wordcount.counter.input-topic=" + TOPIC_IN,
                                "juplo.wordcount.counter.output-topic=" + TOPIC_OUT })
 @EmbeddedKafka(topics = { TOPIC_IN, TOPIC_OUT }, partitions = PARTITIONS)