From 48271d5fd1dbab2dc71d1490e6826048eb0716e2 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sat, 3 Sep 2022 19:22:55 +0200 Subject: [PATCH] Vorlage --- src/main/java/de/juplo/kafka/ApplicationConfiguration.java | 6 +----- src/main/java/de/juplo/kafka/ApplicationRecordHandler.java | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/main/java/de/juplo/kafka/ApplicationConfiguration.java b/src/main/java/de/juplo/kafka/ApplicationConfiguration.java index 033d0cc..a580eb0 100644 --- a/src/main/java/de/juplo/kafka/ApplicationConfiguration.java +++ b/src/main/java/de/juplo/kafka/ApplicationConfiguration.java @@ -82,11 +82,7 @@ public class ApplicationConfiguration props.put("linger.ms", properties.getLingerMs()); 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, - "ADD:" + AddNumberMessage.class.getName() + "," + - "CALC:" + CalculateSumMessage.class.getName()); - + props.put("value.serializer", "TODO: JsonSerializer konfigurieren"); return new KafkaProducer<>(props); } diff --git a/src/main/java/de/juplo/kafka/ApplicationRecordHandler.java b/src/main/java/de/juplo/kafka/ApplicationRecordHandler.java index 8431a53..5f2a201 100644 --- a/src/main/java/de/juplo/kafka/ApplicationRecordHandler.java +++ b/src/main/java/de/juplo/kafka/ApplicationRecordHandler.java @@ -22,11 +22,7 @@ public class ApplicationRecordHandler implements RecordHandler String key = record.key(); int number = record.value(); - for (int i = 1; i <= number; i++) - { - send(key, new AddNumberMessage(number, i)); - } - send(key, new CalculateSumMessage(number)); + // TODO: JSON-Nachrichten verschicken } private void send(String key, Object value) -- 2.20.1