Vorlage
authorKai Moritz <kai@juplo.de>
Sat, 3 Sep 2022 17:22:55 +0000 (19:22 +0200)
committerKai Moritz <kai@juplo.de>
Sun, 4 Sep 2022 05:57:34 +0000 (07:57 +0200)
src/main/java/de/juplo/kafka/ApplicationConfiguration.java
src/main/java/de/juplo/kafka/ApplicationRecordHandler.java

index 033d0cc..a580eb0 100644 (file)
@@ -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);
   }
index 8431a53..5f2a201 100644 (file)
@@ -22,11 +22,7 @@ public class ApplicationRecordHandler implements RecordHandler<String, Integer>
     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)