From f603e6b50dce708d942da12ee7c31d8ee24104c2 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sat, 22 Jun 2024 17:13:29 +0200 Subject: [PATCH] popular: 1.3.0 - Changed the type-mapping from `word` to `key` --- .../kafka/wordcount/popular/PopularStreamProcessor.java | 6 +++--- .../juplo/kafka/wordcount/popular/PopularApplicationIT.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) 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}", -- 2.20.1