swarrot / SwarrotBundle

A symfony bundle for swarrot integration
MIT License
89 stars 59 forks source link

Consumer on multiple queues #201

Closed TakTaki closed 3 years ago

TakTaki commented 4 years ago

Hi, I'm trying to make one of my consumer consume multiple queues but I can't find the command nor the configuration to do so. Is it possible ?

Thanks

odolbeau commented 4 years ago

Hi @TakTaki! No, it's not possible to consume multiple queues with the same worker instance.

TakTaki commented 4 years ago

Thanks for the reply. So, what to you mean when you said https://github.com/swarrot/SwarrotBundle/issues/32#issuecomment-58623873 ? Is this juste a common behavior that Swarrot doesn't handle ?

odolbeau commented 4 years ago

You can launch a worker using bin/console swarrot:consume:my_consumer queue_name [connection_name] 1 worker instance can consume 1 queue but you can launch several workers in parallel:

bin/console swarrot:consume:my_consumer queue_1
bin/console swarrot:consume:my_consumer queue_2
bin/console swarrot:consume:my_consumer queue_3

You will have 3 distinct workers, each consuming a different queue.