1

I noticed several customizers in the KafkaBinderConfiguration, which we can pass to customize the binder. But in the case of multiple binders, the customizer beans won't be picked up. It may relate to this line in DefaultBinderFactory:

boolean useApplicationContextAsParent = binderProperties.isEmpty()
                && this.context != null;

How can these customizers be picked up in a binder context if this binder context's useApplicationContextAsParent equals to false?

Xiaolu Dai
  • 21
  • 3

1 Answers1

0

See the documentation https://docs.spring.io/spring-cloud-stream/docs/3.2.1/reference/html/spring-cloud-stream.html#binder-customizer

Use a BinderCustomizer.

When an application has multiple binders in it and wants to customize the binders, then that can be achieved by providing a BinderCustomizer implementation. In the case of applications with a single binder, this special customizer is not necessary since the binder context can access the customization beans directly. However, this is not the case in a multi-binder scenario, since various binders live in different application contexts. ...

Gary Russell
  • 166,535
  • 14
  • 146
  • 179