WIP
authorKai Moritz <kai@juplo.de>
Sat, 2 Nov 2024 21:12:30 +0000 (22:12 +0100)
committerKai Moritz <kai@juplo.de>
Sat, 9 Nov 2024 15:49:53 +0000 (16:49 +0100)
src/main/java/de/juplo/kafka/ApplicationConfiguration.java

index 1546f2d..7883cf7 100644 (file)
@@ -23,11 +23,11 @@ public class ApplicationConfiguration
   @Bean
   public ExampleConsumer exampleConsumer(
       Consumer<String, String> kafkaConsumer,
+      Producer<String, String> kafkaProducer,
       ApplicationProperties properties,
       Clock clock,
       ConfigurableApplicationContext applicationContext)
   {
-    Producer<String, String> kafkaProducer = kafkaProducer(properties);
     return
         new ExampleConsumer(
             properties.getClientId(),
@@ -65,6 +65,7 @@ public class ApplicationConfiguration
     return new KafkaConsumer<>(props);
   }
 
+  @Bean(destroyMethod = "")
   KafkaProducer<String, String> kafkaProducer(ApplicationProperties properties)
   {
     Properties props = new Properties();