Skip to content

Commit

Permalink
Polish 'Use more specific bean method return types in KafkaAutoConfig…
Browse files Browse the repository at this point in the history
…uration'

See gh-32770
  • Loading branch information
philwebb committed Oct 18, 2022
1 parent c498ad0 commit b02c702
Showing 1 changed file with 4 additions and 4 deletions.
@@ -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");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -74,13 +74,13 @@ public KafkaAutoConfiguration(KafkaProperties properties) {
}

@Bean
@ConditionalOnMissingBean(LoggingProducerListener.class)
@ConditionalOnMissingBean(ProducerListener.class)
public LoggingProducerListener<Object, Object> kafkaProducerListener() {
return new LoggingProducerListener<>();
}

@Bean
@ConditionalOnMissingBean(DefaultKafkaConsumerFactory.class)
@ConditionalOnMissingBean(ConsumerFactory.class)
public DefaultKafkaConsumerFactory<?, ?> kafkaConsumerFactory(
ObjectProvider<DefaultKafkaConsumerFactoryCustomizer> customizers) {
DefaultKafkaConsumerFactory<Object, Object> factory = new DefaultKafkaConsumerFactory<>(
Expand All @@ -90,7 +90,7 @@ public LoggingProducerListener<Object, Object> kafkaProducerListener() {
}

@Bean
@ConditionalOnMissingBean(DefaultKafkaProducerFactory.class)
@ConditionalOnMissingBean(ProducerFactory.class)
public DefaultKafkaProducerFactory<?, ?> kafkaProducerFactory(
ObjectProvider<DefaultKafkaProducerFactoryCustomizer> customizers) {
DefaultKafkaProducerFactory<?, ?> factory = new DefaultKafkaProducerFactory<>(
Expand Down

0 comments on commit b02c702

Please sign in to comment.