Skip to content

Commit b02c702

Browse files
committed
Polish 'Use more specific bean method return types in KafkaAutoConfiguration'
See gh-32770
1 parent c498ad0 commit b02c702

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/kafka/KafkaAutoConfiguration.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2020 the original author or authors.
2+
* Copyright 2012-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -74,13 +74,13 @@ public KafkaAutoConfiguration(KafkaProperties properties) {
7474
}
7575

7676
@Bean
77-
@ConditionalOnMissingBean(LoggingProducerListener.class)
77+
@ConditionalOnMissingBean(ProducerListener.class)
7878
public LoggingProducerListener<Object, Object> kafkaProducerListener() {
7979
return new LoggingProducerListener<>();
8080
}
8181

8282
@Bean
83-
@ConditionalOnMissingBean(DefaultKafkaConsumerFactory.class)
83+
@ConditionalOnMissingBean(ConsumerFactory.class)
8484
public DefaultKafkaConsumerFactory<?, ?> kafkaConsumerFactory(
8585
ObjectProvider<DefaultKafkaConsumerFactoryCustomizer> customizers) {
8686
DefaultKafkaConsumerFactory<Object, Object> factory = new DefaultKafkaConsumerFactory<>(
@@ -90,7 +90,7 @@ public LoggingProducerListener<Object, Object> kafkaProducerListener() {
9090
}
9191

9292
@Bean
93-
@ConditionalOnMissingBean(DefaultKafkaProducerFactory.class)
93+
@ConditionalOnMissingBean(ProducerFactory.class)
9494
public DefaultKafkaProducerFactory<?, ?> kafkaProducerFactory(
9595
ObjectProvider<DefaultKafkaProducerFactoryCustomizer> customizers) {
9696
DefaultKafkaProducerFactory<?, ?> factory = new DefaultKafkaProducerFactory<>(

0 commit comments

Comments
 (0)