-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Messenger] Add --exclude-receivers
to messenger:consume
command
#60979
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 7.4
Are you sure you want to change the base?
Conversation
@Kocal 🎁 |
src/Symfony/Component/Messenger/Command/ConsumeMessagesCommand.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Messenger/Tests/Command/ConsumeMessagesCommandTest.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Messenger/Command/ConsumeMessagesCommand.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Messenger/Command/ConsumeMessagesCommand.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Messenger/Tests/Command/ConsumeMessagesCommandTest.php
Outdated
Show resolved
Hide resolved
52da22d
to
04d44be
Compare
--exclude-queues
consume parameters
3ca4340
to
3379fda
Compare
@Kocal @jbdelhommeau Not sure about the naming of the option guys. By default the command consumes from There is the option So I guess we could have 2 options:
Starting with the second option sounds more appropriate to me as it's not bound to some protocol/technologies. Also the current implementation is about |
3379fda
to
dcde172
Compare
I just push an new version more aligned with @B-Galati feedbacks. |
dcde172
to
4677777
Compare
src/Symfony/Component/Messenger/Command/ConsumeMessagesCommand.php
Outdated
Show resolved
Hide resolved
4677777
to
0406863
Compare
--exclude-queues
consume parameters--exclude-receivers
consume parameters
--exclude-receivers
consume parameters--exclude-queues
to messenger:consume
command
--exclude-queues
to messenger:consume
command--exclude-receivers
to messenger:consume
command
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a line in the changelog file of the component (you can borrow from the PR title)
src/Symfony/Component/Messenger/Command/ConsumeMessagesCommand.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Messenger/Command/ConsumeMessagesCommand.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Messenger/Command/ConsumeMessagesCommand.php
Outdated
Show resolved
Hide resolved
0406863
to
1f706e6
Compare
1f706e6
to
167c1fe
Compare
Done |
This PR adds a new
--exclude-receivers
(shortcut-et
) option to themessenger:consume
command. This option allows users to exclude specific transports/receivers from being consumed when using the--all
flag.What it does and why it's needed:
messenger:consume --all
, you may want to skip certain transports (example the failed transports) without having to list all the others manually. The new--exclude-receivers
option makes this possible.How it works:
This will consume messages from all transports except
queues1
andqueues2
.Behavior:
--exclude-queues
option can only be used with--all
. If used without--all
, anInvalidOptionException
is thrown.RuntimeException
is thrown to prevent running the command with no receivers.Before:
--all
.After:
--exclude-receivers
when using--all
.Tests: