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?
CodePudding user response:
Add a MethodInterceptor
to the container's adviceChain
.
https://docs.spring.io/spring-kafka/docs/current/reference/html/#adviceChain