mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
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
This commit is contained in:
commit
e35de7164e
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2012-2020 the original author or authors.
|
* Copyright 2012-2022 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -75,13 +75,13 @@ public class KafkaAutoConfiguration {
|
|||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
@ConditionalOnMissingBean(ProducerListener.class)
|
@ConditionalOnMissingBean(ProducerListener.class)
|
||||||
public ProducerListener<Object, Object> kafkaProducerListener() {
|
public LoggingProducerListener<Object, Object> kafkaProducerListener() {
|
||||||
return new LoggingProducerListener<>();
|
return new LoggingProducerListener<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
@ConditionalOnMissingBean(ConsumerFactory.class)
|
@ConditionalOnMissingBean(ConsumerFactory.class)
|
||||||
public ConsumerFactory<?, ?> kafkaConsumerFactory(
|
public DefaultKafkaConsumerFactory<?, ?> kafkaConsumerFactory(
|
||||||
ObjectProvider<DefaultKafkaConsumerFactoryCustomizer> customizers) {
|
ObjectProvider<DefaultKafkaConsumerFactoryCustomizer> customizers) {
|
||||||
DefaultKafkaConsumerFactory<Object, Object> factory = new DefaultKafkaConsumerFactory<>(
|
DefaultKafkaConsumerFactory<Object, Object> factory = new DefaultKafkaConsumerFactory<>(
|
||||||
this.properties.buildConsumerProperties());
|
this.properties.buildConsumerProperties());
|
||||||
@ -91,7 +91,7 @@ public class KafkaAutoConfiguration {
|
|||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
@ConditionalOnMissingBean(ProducerFactory.class)
|
@ConditionalOnMissingBean(ProducerFactory.class)
|
||||||
public ProducerFactory<?, ?> kafkaProducerFactory(
|
public DefaultKafkaProducerFactory<?, ?> kafkaProducerFactory(
|
||||||
ObjectProvider<DefaultKafkaProducerFactoryCustomizer> customizers) {
|
ObjectProvider<DefaultKafkaProducerFactoryCustomizer> customizers) {
|
||||||
DefaultKafkaProducerFactory<?, ?> factory = new DefaultKafkaProducerFactory<>(
|
DefaultKafkaProducerFactory<?, ?> factory = new DefaultKafkaProducerFactory<>(
|
||||||
this.properties.buildProducerProperties());
|
this.properties.buildProducerProperties());
|
||||||
|
Loading…
Reference in New Issue
Block a user