Mridang Agarwalla
Mridang Agarwalla

Reputation: 44958

How can I view the enqueued tasks in RabbitMQ?

I'm using RabbitMQ as my message broker and my workers are Celery tasks. I'm trying to diagnose an issue where I'm enqueue tasks to RabbitMQ but Celery doesn't pick then up.

Is there a way I can check what tasks are enqueued in RabbitMQ? I'd like to see the date and time when they are enqueued, any ETA is specified, the arguments and the task name.

I haven't been able to find this information in the docs — maybe I've overlooked it — and was hoping that some of you might know an easy way to inspect the task queue. Thanks.

Upvotes: 11

Views: 14402

Answers (4)

Rune Kaagaard
Rune Kaagaard

Reputation: 6798

I believe the command you are looking for is:

celery inspect reserved

The documentation[1] has the following description:

Reserved tasks are tasks that have been received, but are still waiting to be executed.

Upvotes: 2

Cawb07
Cawb07

Reputation: 2127

As long as the management plugin is enabled, an arbitrary number of messages can be consumed from the queue and optionally requeued:

rabbitmqadmin get queue=queue_name requeue=true count=100

Upvotes: 1

reptilicus
reptilicus

Reputation: 10397

Also some celery tasks to monitor the queue:

http://docs.celeryproject.org/en/latest/userguide/monitoring.html

Check out these commands:

#shows status of all worker nodes
celery status
#List active tasks
celery inspect active
#Show worker statistics (call counts etc.)
celery inspect stats      

Upvotes: 7

mher
mher

Reputation: 10846

You can use Flower to monitor tasks in real time.

https://github.com/mher/flower

Check out also rabbitmqclt command which inspects RabbitMQ server status:

http://www.rabbitmq.com/man/rabbitmqctl.1.man.html

rabbitmqctl list_queues

Upvotes: 14

Related Questions