Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Console][Messenger] cannot suppress retries onRunCommandMessage #60427

Open
@peterpeppered

Description

@peterpeppered

Symfony version(s) affected

7.2.3

Description

dispatching a RunCommandMessage to an async bus like so :

$this->bus->dispatch(new RunCommandMessage('app:do-stuff', false, false));

I would have expected that throwing anUnrecoverableMessageHandlingException in the command would prevent the messenger from retrying this message, but that does not happen. the exception get wrapped in aRunCommandFailureException and is retried as per normal config. seems that the RunCommandMessageHandler does not currently provide for any other way to prevent retries.

How to reproduce

dispatch a RunCommandMessage() for a command like :

use Symfony\Component\Console\Attribute\AsCommand;use Symfony\Component\Console\Command\Command;use Symfony\Component\Console\Input\InputArgument;use Symfony\Component\Console\Input\InputInterface;use Symfony\Component\Console\Input\InputOption;use Symfony\Component\Console\Output\OutputInterface;use Symfony\Component\Console\Style\SymfonyStyle;#[AsCommand(    name: 'dummy',)]class DummyCommand extends Command{    public function __construct()    {        parent::__construct();    }    protected function execute(InputInterface $input, OutputInterface $output): int    {        throw new UnrecoverableMessageHandlingException();    }}

to your default bus and see it get retried

Possible Solution

No response

Additional Context

see discussion on slack with@kbond :

https://symfony-devs.slack.com/archives/C9PQ75TV3/p1747312075618569

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


      [8]ページ先頭

      ©2009-2025 Movatter.jp