0

After checking the answer provided here (https://stackoverflow.com/a/34514526/6613150), I'm able to intercept the message before it's processed. However, I now need to get it after the method who is annotated with @RabbitListener ends.

Any idea?

1 Answers1

0

Add a MethodInterceptor advice to the container's advice chain instead. That way you have access to the Message before and after the listener call (and notification of any exception thrown).

try {
    // before (message is in invocation arguments)
    invocation.proceed();
    // after
}
catch (Exception e) {
    ...
    throw e;
}
finally {
    ...
}
Gary Russell
  • 166,535
  • 14
  • 146
  • 179