diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/kafka/KafkaAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/kafka/KafkaAutoConfiguration.java index 6a6e018329..485ff1e9b9 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/kafka/KafkaAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/kafka/KafkaAutoConfiguration.java @@ -74,14 +74,14 @@ public class KafkaAutoConfiguration { } @Bean - @ConditionalOnMissingBean(ProducerListener.class) - public ProducerListener kafkaProducerListener() { + @ConditionalOnMissingBean(LoggingProducerListener.class) + public LoggingProducerListener kafkaProducerListener() { return new LoggingProducerListener<>(); } @Bean - @ConditionalOnMissingBean(ConsumerFactory.class) - public ConsumerFactory kafkaConsumerFactory( + @ConditionalOnMissingBean(DefaultKafkaConsumerFactory.class) + public DefaultKafkaConsumerFactory kafkaConsumerFactory( ObjectProvider customizers) { DefaultKafkaConsumerFactory factory = new DefaultKafkaConsumerFactory<>( this.properties.buildConsumerProperties()); @@ -90,8 +90,8 @@ public class KafkaAutoConfiguration { } @Bean - @ConditionalOnMissingBean(ProducerFactory.class) - public ProducerFactory kafkaProducerFactory( + @ConditionalOnMissingBean(DefaultKafkaProducerFactory.class) + public DefaultKafkaProducerFactory kafkaProducerFactory( ObjectProvider customizers) { DefaultKafkaProducerFactory factory = new DefaultKafkaProducerFactory<>( this.properties.buildProducerProperties());