8000 [Messenger] no possibility to prevent retrying at this moment | UnrecoverableMessageHandlingException not working · Issue #32325 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
[Messenger] no possibility to prevent retrying at this moment | UnrecoverableMessageHandlingException not working  #32325
Closed
@wtorsi

Description

@wtorsi

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0