Problem: I am migrating from MessageListener interface impl to @RabbitListener. I had logic like this where I was doing \"pre\" and \"post\" message process
Correction
You can use the advice chain in the SimpleRabbitListenerContainerFactory to apply an around advice to listeners created for @RabbitListener
; the two arguments are the Channel
and Message
.
If you only need to take action before calling the listener, you can add MessagePostProcessor
(s) to the container afterReceivePostProcessors
.