spring-kafka icon indicating copy to clipboard operation
spring-kafka copied to clipboard

ConcurrentKafkaListenerContainerFactory to handle multiple RecordInterceptors

Open micd opened this issue 7 months ago • 5 comments

Hi, while working with ConcurrentKafkaListenerContainerFactory and kafka interceptors we encountered a problem that with bean post processor setting an interceptor there is no possibility to check if there is any set and/or accumulate them. The only option is to override an interceptor and the last post processor wins. Eg. see https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues/11793

There are multiple options eg. implementing a getter on listenerContainerFactory or to make ConcurrentKafkaListenerContainerFactory accumulate interceptors into composite interceptors eg. by changing behaviour of setter or adding add method that will do accumulation by using composite interceptor if the field is set.

Would that be possible? What do you think?

micd avatar Jul 16 '24 12:07 micd