-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
Bus::batch ignores job queue, while Bus::chain respects #54286
Comments
Hey there, thanks for reporting this issue. We'll need more info and/or code to debug this further. Can you please create a repository with the command below, commit the code that reproduces the issue as one separate commit on the main/master branch and share the repository here? Please make sure that you have the latest version of the Laravel installer in order to run this command. Please also make sure you have both Git & the GitHub CLI tool properly set up.
Do not amend and create a separate commit with your custom changes. After you've posted the repository, we'll try to reproduce the issue. Thanks! |
I believe you should be able to follow |
@crynobone currently the question is if such difference in behaviour between chain and batch is bug, or it is expected behaviour? |
BatchJobs was introduced in #32830 by taylorotwell |
Laravel Version
11
PHP Version
any supported
Database Driver & Version
No response
Description
Having some job with filled queue with onQueue call.
When I call Bus::chain([$job1, $job2]) they are pushed to specified queue.
When I call Bus::batch([$job1, $job2]) they are pushed to queue default.
Documentation https://laravel.com/docs/11.x/queues#batch-connection-queue is not very clear about this behaviour, only mentions, that queue should be same, and it is same.
Such inconsistent behavior between Chain and Batch is very confusing.
It this behaviour a bug (in this case i will provide PR with fix in code) or it is expected (in this case i will provide PR to documentation, clarifying this behavior) ?
Steps To Reproduce
create ProcessPodcast job with onQueue (second example in) https://laravel.com/docs/11.x/queues#dispatching-to-a-particular-queue
Run Bus::chain([new ProcessPodcast]) and Bus::batch([new ProcessPodcast]) and see, that batch send job to
default
queue, while chain toprocessing
queue.The text was updated successfully, but these errors were encountered: