Übung an die Übung `first-contact` angepasst
authorKai Moritz <kai@juplo.de>
Sun, 11 Jun 2023 18:42:04 +0000 (20:42 +0200)
committerKai Moritz <kai@juplo.de>
Sun, 11 Jun 2023 18:42:04 +0000 (20:42 +0200)
src/main/java/de/juplo/kafka/SimpleProducer.java

index 9e3bad7..db554d7 100644 (file)
@@ -28,10 +28,9 @@ public class SimpleProducer
     props.put("key.serializer", StringSerializer.class.getName());
     props.put("value.serializer", StringSerializer.class.getName());
 
-    producer = new KafkaProducer<>(props);
-
-    this.topic = topic;
     this.id = clientId;
+    this.topic = topic;
+    producer = new KafkaProducer<>(props);
   }
 
   public void run()