[rabbitmq-discuss] Pika Client starts consuming before calling start_consuming
maitreya_vvm at yahoo.co.in
Tue Nov 26 06:25:09 GMT 2013
I have a small problem with RMQ and pika client and would like to ask guyz here for some help. The situation is as below,
I am using RabbitMQ with the pika clients in a scalable solution. The solution requires messaging with two priorities. So every worker (through pika client) gets messages from the HighPriority Queue first and then goes to the Low Priority queue if there are no messages left in the HP Queue. I decide to scale the number of workers according to the number of ready messages and the number of consumers attached to the queue. So the following is the workflow i follow to achieve the above.
1) Register using basic_consume on the queue.
2) Do basic_get from HP Queue
3)If no messages in HP Queue do a basic_get from LP Queue.
I donot execute start_consuming() so the basic_consume is just for the number of consumers count in the RMQ server.
This logic works perfectly fine with the standard Java Client. But when i try to do the same with the Pika Client, the moment the basic_consume is called the data events are processed and the callback function is executed on the incoming message, eventhough the start_consuming() function is not called.
So, a couple of questions here,
1. Is there a way to register as a consumer to a queue without actually starting to consume from the queue (even a hack into the code is fine)
2. Is it bug that basic_consume() starts consuming without actually calling start_consuming() (the actual blocking function), and should i raise an issue in github regarding this ?
Last but not the least, the version of the rabbitMQ server is 3.1.2 and the pika client, i have tried both 0.9.6 and 0.9.13 with the above scenario.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the rabbitmq-discuss