Issue
I want to catch an exception that occurs within kafka listener container, log some attributes from the exception, then rethrow the exception. What is the best way to do this without modifying the existing error handling flow?
Solution
Add a MethodInterceptor
to the container's adviceChain
.
https://docs.spring.io/spring-kafka/docs/current/reference/html/#adviceChain
Answered By - Gary Russell
Answer Checked By - Marie Seifert (JavaFixing Admin)