In my project I have two ques. I would like to know list of all the workers listening to a que. (need a pythonic way of doing this. Celery is running on a different machine and I want the details on other machine.)
Asked
Active
Viewed 56 times
1 Answers
1
Well if you're using rabbitmq as a broker you can do this:
sudo rabbitmqctl list_consumers
To check a specific queue:
lpiner@host:~$ sudo rabbitmqctl list_consumers -p production | grep queue1
queue1 <rabbit@host1-rabbitmq.2.15149.130> None5 true 0 []
queue1 <rabbit@host1-rabbitmq.2.15256.130> None4 true 0 []
queue1 <rabbit@host1-rabbitmq.2.21562.130> None4 true 0 []
queue1 <rabbit@host1-rabbitmq.2.21644.130> None4 true 0 []
queue1 <rabbit@host1-rabbitmq.2.6500.135> None5 true 0 []
queue1 <rabbit@host2-rabbitmq.2.4028.137> None10 true 0 []
queue1 <rabbit@host2-rabbitmq.2.4083.137> None10 true 0 []
queue1 <rabbit@host2-rabbitmq.2.4463.137> None9 true 0 []
queue1 <rabbit@host2-rabbitmq.2.4497.137> None10 true 0 []
queue1 <rabbit@host2-rabbitmq.2.6508.137> None5 true 0 []
You can also use the celery flower UI which is pretty cool. https://flower.readthedocs.io/en/latest/

lpiner
- 467
- 4
- 13
-
Im looking for a python way of doing this and running my celery on a different machine than the one where want the details. – Datta Jul 07 '17 at 15:16
-
It looks like you can do this with the Pika library, https://stackoverflow.com/a/13848105/5339255. I don't think celery has an easy way to do this. – lpiner Jul 07 '17 at 18:44