Skip to content

Container settings are not propagated to individual listeners #3124

@Dragas

Description

@Dragas

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:

  1. Set spring.kafka.listener.immediate-stop to true
  2. create a binding
  3. Create a listener binding customizer to list binding properties
  4. 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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions