-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[Messenger] Be able to start a worker for multiple queues with custom consumption priorities #46334
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
Customization of the receivers priorities thanks to a specification in the command argument `bin/console messenger:consume async_redis^2 async_doctrine^1`
Hey! I see that this is your first PR. That is great! Welcome! Symfony has a contribution guide which I suggest you to read. In short:
Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change. When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor! I am going to sit back now and wait for the reviews. Cheers! Carsonbot |
Hey! I think @upyx has recently worked with this code. Maybe they can help review this? Cheers! Carsonbot |
IMO that adds more problems than solves. The syntax is unsightly, and configuring is tricky. The ordering of consuming messages has been implemented already. It's well documented, simple to understand, easy to use, and covers most cases. For additional flexibility, it is possible to add a custom transport that aggregates others and implements any ordering logic. Moreover, custom transports are more flexible than any strategies: they can be used like strategies and can include them. I think it would be nice to keep things simple for maintenance and use. If you'd like, I can help you to implement exactly the same feature by transports instead of extending workers. |
@ThomasBeauchataud may be close the PR since it too outdated? |
This feature in the first part of the issue #45882.
Thanks to this feature, we no longer have to order receivers the command argument, but we can simply set their priority in the argument as follows :
bin/console messenger:consume async_lower^3 async_high^1 async_med^2
is equivalent to
bin/console messenger:consume order async_high async_med, async_low
This is very convenient when you have a lot of receivers.
When the PR #44294 well be ready, we will be able to create a
mixed
strategy to allow some receivers to have the same priority, and run them with turn by turn