From: Kai Moritz Date: Sun, 17 Apr 2022 10:48:43 +0000 (+0200) Subject: Springify: Type-Mapping für den Nachrichten-Typ ergänzt X-Git-Tag: bytestream-producer~12 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=6ca7376ef5307be0f838401ea996fa8912c6f10b;p=demos%2Fkafka%2Ftraining Springify: Type-Mapping für den Nachrichten-Typ ergänzt --- diff --git a/src/main/java/de/juplo/kafka/RestProducer.java b/src/main/java/de/juplo/kafka/RestProducer.java index e564a66..bccc166 100644 --- a/src/main/java/de/juplo/kafka/RestProducer.java +++ b/src/main/java/de/juplo/kafka/RestProducer.java @@ -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); }