-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Provide a way to define a ContainerCustomizer per KafkaListener #2825
Comments
It is unlikely this would be back ported to versions earlier than the upcoming 3.1. It's really just a convenience feature; the existing single customizer per factory has access to the container's listener id when performing customization. |
Actually, this is not so straightforward; defining multiple beans will disable Boot's capability of auto configuring the default customizer. And, if you only define one bean, it will be detected by Boot and auto configure it into the factory. We will probably have to use a different interface for this customizer. |
Good catch. Didn't see it on the 2.9.x as this configuration has been introduced on the 3.1.x (spring-projects/spring-boot#34033). Seems weird to not have used the ConcurrentKafkaListenerContainerFactoryConfigurer to set the customizer on the factory. This may be confusing to introduce a new interface, but this seems the way to go... |
What about ContainerConfigurer? May it help if I drop a PR for that or do you prefer to implement it yourself? |
The Boot team does not like us using Happy to receive a PR, if we can come up with a name. Maybe |
Looks good to me. Will drop a PR this week. Thanks. |
Following https://stackoverflow.com/questions/77193702/consumerrebalancelistener-and-or-containerproperties-override-per-container,
Through a new property on the KafkaListener annotation, it should be possible to specify the bean name of the ContainerCustomizer associated to the listener.
If provided, this customizer would override the default factory customizer.
See KafkaListenerAnnotationBeanPostProcessor and KafkaListenerEndpoint for internal details.
Would be great to have this feature on both Spring Kafka 2.9.x and 3.0.x
The text was updated successfully, but these errors were encountered: