Description
v4.3.2
When using async transport, UnrecoverableMessageHandlingException
business logic does not work at this moment at all.
Symfony\Component\Messenger\Middleware\HandleMessageMiddleware:82
wraps all \Throwable
(not only UnrecoverableExceptionInterface
exceptions) occurred in handlers in Symfony\Component\Messenger\Exception\HandlerFailedException
, when Symfony\Component\Messenger\Worker:194
wants only UnrecoverableExceptionInterface
.
At this moment the only possible solution to prevent retrying is disable totally retrying strategy.
To reproduce, just throw UnrecoverableExceptionInterface
in any kind of async handlers (i did not test on sync handlers, but think that situation is the same).
As a solution, it's be better to check payload of HandlerFailedException
in Worker
.