From c02d3a6376258ff103c176bf384497a9be678645 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Fri, 9 Jun 2023 11:16:42 +0200 Subject: [PATCH] Beispiel verwendet das Interface, um die erzeugte Instanz abzulegen --- src/main/java/de/juplo/kafka/SimpleProducer.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- 2.20.1