-
Notifications
You must be signed in to change notification settings - Fork 631
Description
Describe the issue
Flags set via spring.kafka.listener do not get propagated to individual listener bindings.
To Reproduce
POC: https://github.com/Dragas/stop-immediate-poc
Steps to reproduce the behavior:
- Set
spring.kafka.listener.immediate-stopto true - create a binding
- Create a listener binding customizer to list binding properties
- Run the application
Version of the framework
Spring Boot 3.5.3
Spring Core 6.2.8
Spring cloud stream kafka 4.3.0
Expected behavior
spring,kafka.listener properties are copied over to individual binding properties
Additional context
Looking at the source code, the https://github.com/spring-cloud/spring-cloud-stream/blob/main/binders/kafka-binder/spring-cloud-stream-binder-kafka/src/main/java/org/springframework/cloud/stream/binder/kafka/KafkaMessageChannelBinder.java#L629 creates an individual properties object per listener container which does not reference original properties that were set via spring.kafka.listener which makes any changes moot.
The same listener customizer can be used to assign individual properties per listener in the context, but I'd expect the properties to have an effect. The stop immediate flag is used as an example.