From 1b1ac5bca62f07dae4188a5797a36b0fbe72058d Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Tue, 14 May 2024 22:25:51 +0200 Subject: [PATCH] counter: 1.2.14 - Set up type-mappings for JSON-Deserialization --- pom.xml | 2 +- .../wordcount/counter/CounterApplicationConfiguriation.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6405d20..3c5e9eb 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ de.juplo.kafka.wordcount counter - 1.2.13 + 1.2.14 Wordcount-Counter Word-counting stream-processor of the multi-user wordcount-example diff --git a/src/main/java/de/juplo/kafka/wordcount/counter/CounterApplicationConfiguriation.java b/src/main/java/de/juplo/kafka/wordcount/counter/CounterApplicationConfiguriation.java index e2a55c0..926045c 100644 --- a/src/main/java/de/juplo/kafka/wordcount/counter/CounterApplicationConfiguriation.java +++ b/src/main/java/de/juplo/kafka/wordcount/counter/CounterApplicationConfiguriation.java @@ -36,6 +36,10 @@ public class CounterApplicationConfiguriation propertyMap.put(JsonDeserializer.TRUSTED_PACKAGES, CounterApplication.class.getPackageName()); propertyMap.put(JsonDeserializer.KEY_DEFAULT_TYPE, Word.class.getName()); propertyMap.put(JsonDeserializer.VALUE_DEFAULT_TYPE, Word.class.getName()); + propertyMap.put( + JsonDeserializer.TYPE_MAPPINGS, + "word:" + Word.class.getName() + "," + + "counter:" + WordCounter.class.getName()); propertyMap.put(JsonDeserializer.REMOVE_TYPE_INFO_HEADERS, Boolean.FALSE); propertyMap.put(StreamsConfig.STATE_DIR_CONFIG, "target"); if (counterProperties.getCommitInterval() != null) -- 2.20.1