Description
Symfony version(s) affected
6.3
Description
The commit 8fc3dcc45d37ba5daaea5549d228cfd10adfb506 introduced a backward-compatibility breaking change in src/Symfony/Component/Messenger/EventListener/SendFailedMessageForRetryListener.php
.
Before this change, when throwing a RecoverableExceptionInterface
, the message was retried infinitely. It is documented in to do exactly that in Force Retrying.
How to reproduce
Don't override max_retries
or set it to a low number like 3 and throw a RecoverableExceptionInterface
. Once the max_retries
threshold is reached the message will be sent to the failed transport.
Possible Solution
Solution 1: Add a separate Exception Interface that respects the max_retries
threshold and revert this commit.
Solution 2: Announce the breaking change and introduce a separate Exception Interface - or an Exception code - that ignores max_retries
.
Additional Context
I'd be happy to implement solution 1 or 2 if you want.