spring-cloud / spring-cloud/spring-cloud-stream

KafkaStreamsFunctionProcessor supports only one StreamsBuilderFactoryBeanConfigurer

Open
#3,164 4 comments 1 reaction 0 assignees View on GitHub

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

  1. Consider a spring-boot-3.5.x project with a custom:
@Bean
public StreamsBuilderFactoryBeanConfigurer kafkaStreamsConfigurer() { ... }
  1. Upgrade to spring-boot-4.0.0
  2. 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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.