I am working with Python, RabbitMQ and Pika.
I have multiple consumers and queues. I want one consumer to get messages from every queues. Let's say I have 2 consumers and 3 queues. I want each of my consumers to read messages from queue number 1, 2 and 3.
I have manage to do so with a basic_get :
basic_get(queue1)
basic_get(queue2)
basic_get(queue3)
=> Get one message from queue 1, one from queue 2, one from queue 3, then repeat.
The "problem" is that I want to use a basic_consume in order to set qos (let queues to push n messages each time). I want to get n messages from queue 1, then n messages from queue 2, n messages from queue 3 and then go back to queue 1 and so on. I don't want to consume all from queue 1, then all from the 2nd, ...
I have not find a way to implement basic_consume for multiple queues. Is it possible to implement basic_consume in my situation?
Also, do I need threads when using basic_consume? It does call a function when a message is sent in RabbitMQ. But this is a listener as I understand. So I cannot do anything while it is listening. Using threads would be helpful to process tasks while listening to new messages, right?
Thanks.