NG
authorKai Moritz <kai@juplo.de>
Fri, 18 Aug 2023 14:27:29 +0000 (16:27 +0200)
committerKai Moritz <kai@juplo.de>
Fri, 18 Aug 2023 15:18:41 +0000 (17:18 +0200)
src/main/java/de/juplo/kafka/chat/backend/persistence/kafka/KafkaServicesConfiguration.java

index 4f6e918..af8c0aa 100644 (file)
@@ -109,11 +109,11 @@ public class KafkaServicesConfiguration
   }
 
   @Bean
-  Consumer<String, ChatMessageTo>  chatMessageChannelConsumer(
+  Consumer<String, AbstractTo>  chatMessageChannelConsumer(
       Properties defaultConsumerProperties,
       ChatBackendProperties chatBackendProperties,
       StringDeserializer stringDeserializer,
-      JsonDeserializer<ChatMessageTo> messageDeserializer)
+      JsonDeserializer<AbstractTo> messageDeserializer)
   {
     Map<String, Object> properties = new HashMap<>();
     defaultConsumerProperties.forEach((key, value) -> properties.put(key.toString(), value));
@@ -136,14 +136,11 @@ public class KafkaServicesConfiguration
   }
 
   @Bean
-  JsonDeserializer<ChatMessageTo> chatMessageDeserializer()
+  JsonDeserializer<AbstractTo> chatMessageDeserializer()
   {
-    JsonDeserializer<ChatMessageTo> deserializer = new JsonDeserializer<>();
+    JsonDeserializer<AbstractTo> deserializer = new JsonDeserializer<>();
     deserializer.configure(
-        Map.of(
-            JsonDeserializer.USE_TYPE_INFO_HEADERS, false,
-            JsonDeserializer.VALUE_DEFAULT_TYPE, ChatMessageTo.class,
-            JsonDeserializer.TRUSTED_PACKAGES, getClass().getPackageName()),
+        Map.of(JsonDeserializer.TRUSTED_PACKAGES, getClass().getPackageName()),
         false );
     return deserializer;
   }