-
Notifications
You must be signed in to change notification settings - Fork 41k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make ConcurrentKafkaListenerContainerFactoryConfigurer Generic #44638
base: main
Are you sure you want to change the base?
Make ConcurrentKafkaListenerContainerFactoryConfigurer Generic #44638
Conversation
…port configuring any container factory Signed-off-by: Dimitrii Lipiridi <dimitrii.lipiridi@delasport.com>
4ca1986
to
3e32cea
Compare
Unfortunately, I am not sure that we should be making this change. The configurer is mostly for applying auto-configuration to custom container that are to be exposed for management of the This PR doesn't introduce any tests and isn't actionable as such. Before you amend that, I'd like to better understand what you actually mean in the two motivations. Can you provide examples of both and show how the current class is relevant? |
@snicoll thanks for your response! Here is the a real example of usage I'm trying to achieve: @Configuration
@RequiredArgsConstructor
public class KafkaConfiguration {
private final KafkaProperties kafkaProperties;
@Bean
public ConcurrentKafkaListenerContainerFactory<String, GenericRecord> buildFactory() {
var buildProperties = this.kafkaProperties.buildConsumerProperties(null);
DefaultKafkaConsumerFactory<String, Object> consumerFactory =
new DefaultKafkaConsumerFactory<>(buildProperties, new StringDeserializer(), new ErrorHandlingDeserializer<>(new KafkaAvroDeserializer()));
ConcurrentKafkaListenerContainerFactory<String, GenericRecord> factory =
new ConcurrentKafkaListenerContainerFactory<>();
ConcurrentKafkaListenerContainerFactoryConfigurer<String, GenericRecord> configurer = new ConcurrentKafkaListenerContainerFactoryConfigurer<>();
configurer.setKafkaProperties(this.kafkaProperties);
configurer.configure(factory, consumerFactory);
return factory;
}
} |
Signed-off-by: Dimitrii Lipiridi <dimitrii.lipiridi@delasport.com>
Summary
This PR updates ConcurrentKafkaListenerContainerFactoryConfigurer to be generic, allowing it to configure any container factory instead of being limited to <Object, Object>.
Motivation