spring-cloud / spring-cloud/spring-cloud-stream
KafkaStreamsFunctionProcessor supports only one StreamsBuilderFactoryBeanConfigurer
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.1k
- Forks
- 646
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 8
Description
The KafkaStreamsFunctionProcessor supports only a single StreamsBuilderFactoryBeanConfigurer.
Shouldn't it support a list of configurers?
The issue arose when upgrading to spring-boot-4.0.0 which has KafkaMetricsAutoConfiguration now in the spring-boot-kafka library.
My configurer was then silently ignored because getIfUnique returned null.
To Reproduce
- Consider a spring-boot-3.5.x project with a custom:
@Bean
public StreamsBuilderFactoryBeanConfigurer kafkaStreamsConfigurer() { ... }
- Upgrade to spring-boot-4.0.0
- Because of spring-kafka-4.0.0 a second StreamsBuilderFactoryBeanConfigurer will be in the context and both of them will be silently ignored now in the KafkaStreamsBinderSupportAutoConfiguration
Obviously this can easily be mitigated by adding @Primary to the custom Configurer if you don't care about the metrics like me.
Version of the framework
spring-cloud-2025.1.0
spring-boot-4.0.0
Expected behavior
Both Configurers are applied to the stream binding function.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in KafkaStreamsBinderSupportAutoConfiguration.java around the KafkaStreamsFunctionProcessor at line 390, and inspect how getIfUnique obtains the StreamsBuilderFactoryBeanConfigurer. Reproduce the context with the custom configurer and the Spring Boot Kafka metrics configurer; done means both configurers are applied to the stream binding function rather than silently ignored.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, kafka, spring, spring-boot
- Domain
- backend, stream-processing
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100