WIP
authorKai Moritz <kai@juplo.de>
Tue, 14 May 2024 21:56:20 +0000 (23:56 +0200)
committerKai Moritz <kai@juplo.de>
Tue, 14 May 2024 21:56:20 +0000 (23:56 +0200)
src/main/java/de/juplo/kafka/wordcount/top10/Top10ApplicationConfiguration.java

index fdb2e6b..224258c 100644 (file)
@@ -32,11 +32,15 @@ public class Top10ApplicationConfiguration
                props.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, properties.getBootstrapServer());
                props.put(StreamsConfig.DEFAULT_KEY_SERDE_CLASS_CONFIG, JsonSerde.class.getName());
                props.put(StreamsConfig.DEFAULT_VALUE_SERDE_CLASS_CONFIG, JsonSerde.class.getName());
-               props.put(JsonSerializer.ADD_TYPE_INFO_HEADERS, false);
                props.put(JsonDeserializer.TRUSTED_PACKAGES, Top10Application.class.getPackageName());
-               props.put(JsonDeserializer.KEY_DEFAULT_TYPE, Key.class.getName());
-               props.put(JsonDeserializer.VALUE_DEFAULT_TYPE, Counter.class.getName());
-               props.put(JsonDeserializer.USE_TYPE_INFO_HEADERS, false);
+               props.put(
+                               JsonDeserializer.TYPE_MAPPINGS,
+                               "word:" + Key.class.getName() + "," +
+                               "counter:" + Counter.class.getName());
+               props.put(JsonDeserializer.REMOVE_TYPE_INFO_HEADERS, Boolean.FALSE);
+               props.put(
+                               JsonDeserializer.TYPE_MAPPINGS,
+                               "ranking:" + Ranking.class.getName());
                props.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest");
 
                return props;