Skip to content

KafkaStreamsFunctionProcessor supports only one StreamsBuilderFactoryBeanConfigurer #3164

@migu83

Description

@migu83

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions