From: Kai Moritz Date: Fri, 9 Jun 2023 09:16:42 +0000 (+0200) Subject: Beispiel verwendet das Interface, um die erzeugte Instanz abzulegen X-Git-Tag: grundlagen/simple-producer---2023-06-signal~5 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=c02d3a6376258ff103c176bf384497a9be678645;p=demos%2Fkafka%2Ftraining Beispiel verwendet das Interface, um die erzeugte Instanz abzulegen --- diff --git a/src/main/java/de/juplo/kafka/SimpleProducer.java b/src/main/java/de/juplo/kafka/SimpleProducer.java index 9fcaa6e..9e3bad7 100644 --- a/src/main/java/de/juplo/kafka/SimpleProducer.java +++ b/src/main/java/de/juplo/kafka/SimpleProducer.java @@ -1,6 +1,7 @@ package de.juplo.kafka; import lombok.extern.slf4j.Slf4j; +import org.apache.kafka.clients.producer.Producer; import org.apache.kafka.clients.producer.KafkaProducer; import org.apache.kafka.clients.producer.ProducerRecord; import org.apache.kafka.common.serialization.StringSerializer; @@ -13,7 +14,7 @@ public class SimpleProducer { private final String id; private final String topic; - private final KafkaProducer producer; + private final Producer producer; private long produced = 0; private volatile boolean running = true;