Spring Managed Consumer Interceptors

Viewed 79

Following https://github.com/spring-projects/spring-kafka/issues/2049, wouldn't it make sense to also support consumer interceptors?

The consumer interceptor may be set on the ConsumerProperties before being used by the ListenerConsumer. To simplify the usage, a composite and an empty interceptor could also be provided.

A similar approach could also be used for Kafka streams.

I can contribute on this request.

1 Answers

Yes, it makes sense; but we might want to make the existing RecordInterceptor and BatchInterceptor extend ConsumerInterceptor instead of adding more properties, to avoid any confusion.

Looking forward to the contribution.

Related