In der Configuration wird das Interface des `KafkaProducer` übergeben
authorKai Moritz <kai@juplo.de>
Sun, 27 Oct 2024 13:05:17 +0000 (14:05 +0100)
committerKai Moritz <kai@juplo.de>
Tue, 29 Oct 2024 17:06:38 +0000 (18:06 +0100)
src/main/java/de/juplo/kafka/ApplicationConfiguration.java

index 1c4262e..776c737 100644 (file)
@@ -1,6 +1,7 @@
 package de.juplo.kafka;
 
 import org.apache.kafka.clients.producer.KafkaProducer;
+import org.apache.kafka.clients.producer.Producer;
 import org.apache.kafka.common.serialization.StringSerializer;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.annotation.Bean;
@@ -16,7 +17,7 @@ public class ApplicationConfiguration
   @Bean
   public ExampleProducer exampleProducer(
       ApplicationProperties properties,
-      KafkaProducer<String, String> kafkaProducer)
+      Producer<String, String> kafkaProducer)
   {
     return
         new ExampleProducer(