Skip to content

[Messenger] Message loss on RejectRedeliveredMessageException #53311

Closed
@beermeat

Description

@beermeat

Symfony version(s) affected

6.4.0

Description

As described in RejectRedeliveredMessageMiddleware - RejectRedeliveredMessageException should trigger the retry logic:

throw new RejectRedeliveredMessageException('Redelivered message from AMQP detected that will be rejected and trigger the retry logic.');

But after RejectRedeliveredMessageException started implement UnrecoverableExceptionInterface (#51756) no retry logic will occur and the message just will be removed from the queue (see SendFailedMessageForRetryListener::shouldRetry)

@nikophil

when a RejectRedeliveredMessageException is thrown once, it is actually retried because it does not implement UnrecoverableExceptionInterface but we know it will always because the stamp AmqpReceivedStamp will always be there

No, because AmqpReceivedStamp implements NonSendableStampInterface. And retry logic will publish new message to a queue (with delay), so second time there is will new instance AmqpReceivedStamp without redelivery flag.

How to reproduce

no reproduce required

Possible Solution

Rollback #51756

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions