Symfony messenger get retry count in handler

Viewed 555

I have implemented symfony messenger https://symfony.com/doc/current/messenger.html. I want to get retry count in handler class which implements MessageHandlerInterface

Messenger consumer command throws an error and retries it 5 times according to configuration. So I want to get retry count in handler so I can add some logic accordingly.

I also tried to create middleware as mentioned in this answer https://stackoverflow.com/a/61078739. But this middleware doesn't get executed.

0 Answers
Related