popular: 1.3.0 - Changed the type-mapping from `word` to `key`
authorKai Moritz <kai@juplo.de>
Sat, 22 Jun 2024 15:13:29 +0000 (17:13 +0200)
committerKai Moritz <kai@juplo.de>
Sat, 22 Jun 2024 15:31:55 +0000 (17:31 +0200)
src/main/java/de/juplo/kafka/wordcount/popular/PopularStreamProcessor.java
src/test/java/de/juplo/kafka/wordcount/popular/PopularApplicationIT.java

index 896cb1d..74aa2c6 100644 (file)
@@ -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())
index 1a5cbf4..3c91e1c 100644 (file)
@@ -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}",