From: Kai Moritz Date: Wed, 17 Jul 2024 17:20:38 +0000 (+0200) Subject: Aligned the example with the example for a Sliding Window X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=656d4fb60f19d218726e36f27d25ec896a35ddae;p=demos%2Fkafka%2Fwordcount Aligned the example with the example for a Sliding Window * *Note:* Both examples need an explicit configuration for the materialization of the state as store, when suppression is activated! --- diff --git a/src/test/java/de/juplo/kafka/wordcount/counter/AggregationTopologyTest.java b/src/test/java/de/juplo/kafka/wordcount/counter/AggregationTopologyTest.java index 8b64042..3dfd235 100644 --- a/src/test/java/de/juplo/kafka/wordcount/counter/AggregationTopologyTest.java +++ b/src/test/java/de/juplo/kafka/wordcount/counter/AggregationTopologyTest.java @@ -23,6 +23,7 @@ import static org.assertj.core.api.Assertions.assertThat; @Slf4j public class AggregationTopologyTest { + static final String STORE_NAME = "aggregate-store"; static final Duration INACTIVITY_GAP = Duration.ofSeconds(2); static final SessionWindows WINDOWS = SessionWindows.ofInactivityGapWithNoGrace(INACTIVITY_GAP); @@ -39,7 +40,7 @@ public class AggregationTopologyTest .windowedBy(WINDOWS) .reduce( (aggregate, value) -> aggregate + "-" + value, - Materialized.>as("aggregated-store") + Materialized.>as(STORE_NAME) .withKeySerde(Serdes.String()) .withValueSerde(Serdes.String())) .suppress(Suppressed.untilWindowCloses(Suppressed.BufferConfig.unbounded()))