From: Kai Moritz Date: Sat, 22 Jun 2024 15:13:29 +0000 (+0200) Subject: popular: 1.3.0 - Changed the type-mapping from `word` to `key` X-Git-Tag: popular-1.3.0~1 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=f603e6b50dce708d942da12ee7c31d8ee24104c2;p=demos%2Fkafka%2Fwordcount popular: 1.3.0 - Changed the type-mapping from `word` to `key` --- diff --git a/src/main/java/de/juplo/kafka/wordcount/popular/PopularStreamProcessor.java b/src/main/java/de/juplo/kafka/wordcount/popular/PopularStreamProcessor.java index 896cb1d..74aa2c6 100644 --- a/src/main/java/de/juplo/kafka/wordcount/popular/PopularStreamProcessor.java +++ b/src/main/java/de/juplo/kafka/wordcount/popular/PopularStreamProcessor.java @@ -142,11 +142,11 @@ public class PopularStreamProcessor return typeMappingsConfig(WindowedWord.class, WordCounter.class); } - public static String typeMappingsConfig(Class wordClass, Class wordCounterClass) + public static String typeMappingsConfig(Class keyClass, Class counterClass) { return Map.of( - "word", wordClass, - "counter", wordCounterClass) + "key", keyClass, + "counter", counterClass) .entrySet() .stream() .map(entry -> entry.getKey() + ":" + entry.getValue().getName()) diff --git a/src/test/java/de/juplo/kafka/wordcount/popular/PopularApplicationIT.java b/src/test/java/de/juplo/kafka/wordcount/popular/PopularApplicationIT.java index 1a5cbf4..3c91e1c 100644 --- a/src/test/java/de/juplo/kafka/wordcount/popular/PopularApplicationIT.java +++ b/src/test/java/de/juplo/kafka/wordcount/popular/PopularApplicationIT.java @@ -42,7 +42,7 @@ import static org.awaitility.Awaitility.await; "spring.kafka.consumer.auto-offset-reset=earliest", "spring.kafka.consumer.key-deserializer=org.springframework.kafka.support.serializer.JsonDeserializer", "spring.kafka.consumer.value-deserializer=org.springframework.kafka.support.serializer.JsonDeserializer", - "spring.kafka.consumer.properties.spring.json.type.mapping=word:de.juplo.kafka.wordcount.stats.OutputWindowedWord,counter:de.juplo.kafka.wordcount.stats.OutputWordCounter", + "spring.kafka.consumer.properties.spring.json.type.mapping=key:de.juplo.kafka.wordcount.stats.OutputWindowedWord,counter:de.juplo.kafka.wordcount.stats.OutputWordCounter", "logging.level.root=WARN", "logging.level.de.juplo=DEBUG", "juplo.wordcount.popular.bootstrap-server=${spring.embedded.kafka.brokers}",