Open vkollin opened 3 months ago
There are also this issues/PRs
RejectRedeliveredMessageException
implements UnrecoverableExceptionInterface
@nikophil
So maybe the solution would be to make it somehow configurable if RejectRedeliveredMessageException
is unrecoverable or not, because it might be depend on the environment/architecture of the application what is the expected behavior.
Symfony version(s) affected
6.4
Description
Setup rabbitMQ transport:
max_retries: 0
failure_transport via doctrineWe discovered some strange behavior of our async transport running with rabbitMQ. If an async message fails it is not be retried but is send to the failure transport as expected.
But in some cases the message is redelivered by rabbitMQ and
RejectRedeliveredMessageMiddleware
throws theRejectRedeliveredMessageException
.The
Worker
rejects the message as expected, and dispatches anWorkerMessageFailedEvent
which will triggerSendFailedMessageToFailureTransportListener
in the end.Inside
SendFailedMessageToFailureTransportListener
there is nothing that checks if theRejectRedeliveredMessageException
was thrown.Im not quite sure if this is the expected behavior because currently it duplicates messages by sending both to the failure transport
How to reproduce
Message Handler throws an exception. Sometimes the message is unexpectedly redelivered and is handled by
RejectRedeliveredMessageMiddleware
Possible Solution
SendFailedMessageToFailureTransportListener
checks theWorkerMessageFailedEvent
if anRejectRedeliveredMessageException
was thrown and does nothing if so (if it is the expected behavior)Additional Context
No response