Q:

How to set up UncaughtExceptionHandlers for multiple bindings in spring kafka streams?

Right now, I'm trying to access the underlying kafka streams handle by following - https://cloud.spring.io/spring-cloud-static/Finchley.SR2/multi/multi__apache_kafka_streams_binder.html#_accessing_the_underlying_kafkastreams_object
Was wondering if there is a more idiomatic way to do this. Especially when there are mutliple bindings.

A:

You can call context.getBeansOfType(StreamsBuilderFactoryBean.class, false, false) to get a map of beanName:factoryBean.
However, you should be careful not to do this too early in the context lifecycle because you may cause premature bean instantiation.
Probably best to do it in a SmartInitializingSingleton.

