Springify: Type-Mapping für den Nachrichten-Typ ergänzt
authorKai Moritz <kai@juplo.de>
Sun, 17 Apr 2022 10:48:43 +0000 (12:48 +0200)
committerKai Moritz <kai@juplo.de>
Sun, 12 Jun 2022 13:23:09 +0000 (15:23 +0200)
src/main/java/de/juplo/kafka/RestProducer.java

index e564a66..bccc166 100644 (file)
@@ -40,6 +40,7 @@ public class RestProducer
     props.put("compression.type", properties.getCompressionType());
     props.put("key.serializer", StringSerializer.class.getName());
     props.put("value.serializer", JsonSerializer.class.getName());
+    props.put(JsonSerializer.TYPE_MAPPINGS, "message:" + ClientMessage.class.getName());
 
     this.producer = new KafkaProducer<>(props);
   }