-
Notifications
You must be signed in to change notification settings - Fork 19
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
Queue Worker filtered removing messages from all queues #117
Comments
How would someone go about reproducing the issue you're having? Are you able to reproduce this issue using a transport that isn't mongo db? |
I didn't try it in another transport, only did it with mongodb. But if it helps I can try it with another. Push 2 jobs to the queue, both with different 'queue' options as below Open any database client (I'm using MongoDB Compass) to check if the jobs were saved on the queue collection. After that, run the worker as below After you run the worker, only the "test" job will be executed, but both jobs will be erased from the queue. The "new-test" job will be erased without execution. |
I tried to reproduce this and think there is something fishy going on. I'm using beanstalkd as the backend. It looks like all jobs are being put in the same tube (beanstalk queue). I created an $ galley cake example --queue test
Options: {"queue":"test"}
Job Queued
$ galley exec -T beanstalk ash -s < stats.sh
==> enqueue.app.default <==
current-jobs-ready: 1
$ galley cake example --queue new-test
Options: {"queue":"new-test"}
Job Queued
$ galley exec -T beanstalk ash -s < stats.sh
==> enqueue.app.default <==
current-jobs-ready: 2 When I start a worker it looks like both jobs get pulled off the default queue. One of them is "routed" to an event subscriber. The other is routed to "0" subscribers.
The only way I can seem to get the jobs onto different queues is to add the 'Queue' => [
'test' => [
'url' => 'beanstalk://beanstalk:11300',
'queue' => 'test',
],
'new-test' => [
'url' => 'beanstalk://beanstalk:11300',
'queue' => 'new-test',
],
], Then I pass $ galley cake example --config test
Options: {"config":"test"}
Job Queued
$ galley cake example --config new-test
Options: {"config":"new-test"}
Job Queued
$ galley exec -T beanstalk ash -s < stats.sh
==> enqueue.app.test <==
current-jobs-ready: 1
==> enqueue.app.new-test <==
current-jobs-ready: 1 Then when I run the queue worker with the |
I think we might have an issue in how messages are being enqueued then. I can take a look. |
I've tracked this down to being related to how While the I'm starting to think that all the |
The output we're seeing when messages are consumed is coming from the RouteProcessor which matches messages with 'routes'. Unfortunately our current worker command on binds a single route. I think if we were to call I think if you're using a transport like beanstalk or files that don't support fanout workloads you need to use separate queue configurations instead. |
Hello,
I'm using cake4 and mongoDb as transport
I've the following scenario where I've 2 different messages in 2 different queues
QueueManager::push(ExampleJob::class, ['id' => 1, 'code' => 'oi1'], ['queue' => 'test']);
QueueManager::push(ExampleJob::class, ['id' => 1, 'code' => 'oi1'], ['queue' => 'new-test']);
And when I run the worker by queue, all messages are removed from the database but only the correct queue is called.
If I run the cli below, both jobs will be removed from database, but only the first one will run.
bin/cake queue worker --queue=test
Am I using it wrongly or is this a bug?
Thank you
The text was updated successfully, but these errors were encountered: