Beispiele verwenden das Interface, um die erzeugte Instanz abzulegen
authorKai Moritz <kai@juplo.de>
Fri, 9 Jun 2023 09:16:42 +0000 (11:16 +0200)
committerKai Moritz <kai@juplo.de>
Sun, 11 Jun 2023 20:25:10 +0000 (22:25 +0200)
src/main/java/de/juplo/kafka/RestProducer.java

index debe366..cecb980 100644 (file)
@@ -2,6 +2,7 @@ package de.juplo.kafka;
 
 import lombok.RequiredArgsConstructor;
 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.springframework.http.HttpStatus;
@@ -20,7 +21,7 @@ public class RestProducer
   private final String id;
   private final String topic;
   private final Integer partition;
-  private final KafkaProducer<String, String> producer;
+  private final Producer<String, String> producer;
 
   private long produced = 0;