StreamsBuilderFactoryBeanCustomizer provides the exact same functionality than StreamsBuilderFactoryBeanConfigurer.

This works well when using the default Spring configuration but it can become a pain when custom StreamsBuilderFactoryBean(s) need(s) to be created.

For this reason, this interface should be deprecated before being abandoned from Spring Boot to only rely on the configurer coming from Spring Kafka.

More details about the issue can be found here

https://stackoverflow.com/questions/75101801/streamsbuilderfactorybeancustomizer-vs-streamsbuilderfactorybeanconfigurer

Comment From: mhalbritter

StreamsBuilderFactoryBeanCustomizer is from Boot, StreamsBuilderFactoryBeanConfigurer is from spring-kafka. As they provide the same functionality, we should remove StreamsBuilderFactoryBeanCustomizer from Boot and only use the spring-kafka class.

I labeled it as team-attention to see what the team thinks.

Comment From: wilkinsona

Consolidation sounds like a good idea to me.

One difference between the two interfaces is that StreamsBuilderFactoryBeanConfigurer extends Ordered and has a default order of 0. StreamsBuilderFactoryBeanCustomizer does not so effectively has a default order of lowest precedence. We'd need to document this as it could lead to some subtle bugs.

As part of the consolidation it would be good to review KafkaStreamsFactoryBeanConfigurer in Boot. It's an InitializingBean and it mutates the StreamsBuilderFactoryBean in afterPropertiesSet. Generally speaking, that's not a good idea as it makes it unclear if the factory bean may be used before it has been mutated. We'd be better mutating it using a StreamsBuilderFactoryBeanConfigurer implementation if we can.

Comment From: nosan

@wilkinsona Could you please assign this issue to me?

Comment From: wilkinsona

Done. Thanks, @nosan!

Comment From: nosan

Should we completely remove Boot's customizer or deprecate it? From my perspective, since this is an enhancement and it's landing in 4.x, Boot's version could be entirely deleted.