-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Description
Symfony version(s) affected
6.4
Description
Hello,
If messages retrieved from the queue with $amqpReceivedStamp->getAmqpEnvelope()->isRedelivery()
are true, the RejectRedeliveredMessageException
will be thrown in RejectRedeliveredMessageMiddleware. This should cause the default retry logic to run, but because RejectRedeliveredMessageException implements UnrecoverableExceptionInterface, and because in the SendFailedMessageForRetryListener::shouldRetry()
logic we check for UnrecoverableExceptionInterface
, the retry logic is not triggered.
How to reproduce
- Consume message that has Redelivered stamp.
- Message should be queued again with default retry logic, but instead it is gone.
Possible Solution
Just revert that commit: symfony/messenger@2479dc6 (i don't understand intention of this commit, maybe just use \Symfony\Component\Messenger\Exception\RecoverableExceptionInterface
instead) or change description of \Symfony\Component\Messenger\Middleware\RejectRedeliveredMessageMiddleware
because it is misleading otherwise.
Additional Context
interesting classes:
\Symfony\Component\Messenger\Middleware\RejectRedeliveredMessageMiddleware
\Symfony\Component\Messenger\Exception\RejectRedeliveredMessageException
\Symfony\Component\Messenger\EventListener\SendFailedMessageForRetryListener::shouldRetry
This bug makes usage of rabbitMQ much more difficult because now it is not possible to check messages in web interface, if the check is done, it would be not possible to use that message.