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

[Messenger] Add--exclude-receivers tomessenger: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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@jbdelhommeau
Copy link
Contributor

@jbdelhommeaujbdelhommeau commentedJun 30, 2025
edited
Loading

QA
Branch?7.4
Bug fix?no
New feature?yes
Deprecations?no
Docssymfony/symfony-docs#21165
LicenseMIT

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:

  • When runningmessenger: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.
  • This improves flexibility and usability for complex Messenger setups.

How it works:

php bin/console messenger:consume --all --exclude-receivers=queues1 --exclude-receivers=queues2

This will consume messages from all transports exceptqueues1 andqueues2.

Behavior:

  • The--exclude-queues option can only be used with--all. If used without--all, anInvalidOptionException is thrown.
  • If all queues are excluded, aRuntimeException is thrown to prevent running the command with no receivers.

Before:

  • No way to exclude specific receivers when using--all.

After:

  • You can now exclude queues with--exclude-receivers when using--all.

Tests:

  • Unit tests have been added to cover the new option, its validation, and edge cases.

Kocal reacted with heart emoji
@jbdelhommeau
Copy link
ContributorAuthor

@Kocal 🎁

Kocal reacted with heart emoji

@jbdelhommeaujbdelhommeauforce-pushed themessenger-exlude-receivers branch from52da22d to04d44beCompareJune 30, 2025 12:34
@carsonbotcarsonbot changed the titlechore: add exclude-receivers consume parameters[Messenger] chore: add exclude-receivers consume parametersJun 30, 2025
@nicolas-grekasnicolas-grekas changed the title[Messenger] chore: add exclude-receivers consume parameters[Messenger] Add --exclude-queues consume parametersJun 30, 2025
@OskarStarkOskarStark changed the title[Messenger] Add --exclude-queues consume parameters[Messenger] Add--exclude-queues consume parametersJun 30, 2025
@jbdelhommeaujbdelhommeauforce-pushed themessenger-exlude-receivers branch 3 times, most recently from3ca4340 to3379fdaCompareJune 30, 2025 13:09
@B-Galati
Copy link
Contributor

B-Galati commentedJul 1, 2025
edited
Loading

@Kocal@jbdelhommeau Not sure about the naming of the option guys.

By default the command consumes fromreceivers/transports.

There is the option--queues but it's only for some implementations like AMQP.

So I guess we could have 2 options:

  • --exclude-queues
  • --exclude-receivers or--exclude-tranports (I prefer the later on my end because the config key name istransports)

Starting with the second option sounds more appropriate to me as it's not bound to some protocol/technologies. Also the current implementation is aboutreceivers/transports notqueues.

Kocal, OskarStark, and jbdelhommeau reacted with thumbs up emoji

@jbdelhommeaujbdelhommeauforce-pushed themessenger-exlude-receivers branch from3379fda todcde172CompareJuly 1, 2025 12:51
@jbdelhommeau
Copy link
ContributorAuthor

I just push an new version more aligned with@B-Galati feedbacks.

Kocal reacted with thumbs up emoji

@jbdelhommeaujbdelhommeauforce-pushed themessenger-exlude-receivers branch fromdcde172 to4677777CompareJuly 1, 2025 12:57
@jbdelhommeaujbdelhommeauforce-pushed themessenger-exlude-receivers branch from4677777 to0406863CompareJuly 2, 2025 07:38
@nicolas-grekasnicolas-grekas changed the title[Messenger] Add--exclude-queues consume parameters[Messenger] Add--exclude-receivers consume parametersJul 7, 2025
@nicolas-grekasnicolas-grekas changed the title[Messenger] Add--exclude-receivers consume parameters[Messenger] Add--exclude-queues tomessenger:consume commandJul 7, 2025
@nicolas-grekasnicolas-grekas changed the title[Messenger] Add--exclude-queues tomessenger:consume command[Messenger] Add--exclude-receivers tomessenger:consume commandJul 7, 2025
Copy link
Member

@nicolas-grekasnicolas-grekas left a 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)

@jbdelhommeau
Copy link
ContributorAuthor

Please add a line in the changelog file of the component (you can borrow from the PR title)

Done

@nicolas-grekas
Copy link
Member

(please rebase to get rid of the merge commit and trigger tests again)

jbdelhommeau reacted with thumbs up emoji

@jbdelhommeaujbdelhommeauforce-pushed themessenger-exlude-receivers branch 4 times, most recently from309f256 toa7ee972CompareAugust 21, 2025 07:15
7.3
---

* Add`--exclude-receivers` option to the`messenger:consume command`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Should be moved to a new 7.4 section.

@fabpotfabpotforce-pushed themessenger-exlude-receivers branch froma7ee972 to9d9a9d8CompareAugust 23, 2025 06:22
@fabpot
Copy link
Member

Thank you@jbdelhommeau.

@fabpotfabpot merged commitff682f8 intosymfony:7.4Aug 23, 2025
10 of 12 checks passed
javiereguiluz added a commit to javiereguiluz/symfony-docs that referenced this pull requestSep 2, 2025
…tion for `messenger:consume` command (OskarStark)This PR was squashed before being merged into the 7.4 branch.Discussion----------[Messenger] Document the `--exclude-receivers` option for `messenger:consume` command- Add documentation for the new `--exclude-receivers` option- Show usage example with `--all` flag- Include version annotation for Symfony 7.4- Add note about requirement to use with `--all` option### Code PR*symfony/symfony#60979Commits-------d252713 [Messenger] Document the `--exclude-receivers` option for `messenger:consume` command
This was referencedOct 27, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas left review comments

@OskarStarkOskarStarkOskarStark left review comments

@fabpotfabpotfabpot approved these changes

+1 more reviewer

@KocalKocalKocal left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

7.4

Development

Successfully merging this pull request may close these issues.

7 participants

@jbdelhommeau@B-Galati@nicolas-grekas@fabpot@OskarStark@Kocal@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp