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

Appearance settings

[Messenger] Is there a way to consume all transports without providing their names (?) #51989

Unanswered
VincentLanglet asked this question in Q&A
Discussion options

Hi, I'm trying a migration from enqueue (https://github.com/php-enqueue/enqueue) to symfony messenger.

When running the consumer, I was using

bin/console enqueue:consume

which was consuming all the queues, thanks to this code
https://github.com/php-enqueue/enqueue/blob/master/Symfony/Client/ConsumeCommand.php#L118-L120

When running

bin/console messenger:consume

I'm getting prompt about which transport I want to consume, isnt a way to run something like --all in order to consume everything ? I know I can list

bin/console messenger:consume foo1,foo2,...

but this means I have to update every time this command when I add new transport.

For the record, I'm using different transports in order to put messages in different queue, following the doc

framework:
    messenger:
        transports:
            async_priority_high:
                dsn: '%env(MESSENGER_TRANSPORT_DSN)%'
                options:
                    queue_name: high
            async_priority_low:
                dsn: '%env(MESSENGER_TRANSPORT_DSN)%'
                options:
                    queue_name: low

        routing:
            'App\Message\SmsNotification': async_priority_low
            'App\Message\NewUserWelcomeEmail': async_priority_high
You must be logged in to vote

Replies: 2 comments

Comment options

Inspecting

protected function execute(InputInterface $input, OutputInterface $output): int

it looks like it's not possible right now (I wonder why it doesn't throw on empty receivers when running messenger:consume --no-interaction).

You must be logged in to vote
0 replies
Comment options

Here is the solution :)
#52411

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.