Skip to content

Commit e35de71

Browse files
committed
Merge pull request #32770 from YuanHao97
* pr/32770: Polish 'Use more specific bean method return types in KafkaAutoConfiguration' Use more specific bean method return types in KafkaAutoConfiguration Closes gh-32770
2 parents a92388c + b02c702 commit e35de71

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.
@@ -75,13 +75,13 @@ public KafkaAutoConfiguration(KafkaProperties properties) {
7575

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

8282
@Bean
8383
@ConditionalOnMissingBean(ConsumerFactory.class)
84-
public ConsumerFactory<?, ?> kafkaConsumerFactory(
84+
public DefaultKafkaConsumerFactory<?, ?> kafkaConsumerFactory(
8585
ObjectProvider<DefaultKafkaConsumerFactoryCustomizer> customizers) {
8686
DefaultKafkaConsumerFactory<Object, Object> factory = new DefaultKafkaConsumerFactory<>(
8787
this.properties.buildConsumerProperties());
@@ -91,7 +91,7 @@ public ProducerListener<Object, Object> kafkaProducerListener() {
9191

9292
@Bean
9393
@ConditionalOnMissingBean(ProducerFactory.class)
94-
public ProducerFactory<?, ?> kafkaProducerFactory(
94+
public DefaultKafkaProducerFactory<?, ?> kafkaProducerFactory(
9595
ObjectProvider<DefaultKafkaProducerFactoryCustomizer> customizers) {
9696
DefaultKafkaProducerFactory<?, ?> factory = new DefaultKafkaProducerFactory<>(
9797
this.properties.buildProducerProperties());

0 commit comments

Comments
 (0)