查找哪个任务进入哪个队列
我正在将 RabbitMQ 与 Celery 一起使用,并且我已经为该任务设置了一些自定义路由设置。一种特定类型的任务进入一个队列,所有其他任务进入另一个队列。现在我想验证它是否有效。
为此,我想检查哪些任务进入了哪个队列。不幸的是,我没有找到任何可以帮助我的东西。 celeryev 监视器仅提供有关已收到哪些任务及其完成状态的信息。 rabbitmqctl 仅向我提供有关当前正在运行和正在等待的任务的信息 - 所以我无法看到我的预期任务转到哪个队列。
有人能帮我解决这个问题吗?
I am using RabbitMQ with Celery and I have set some custom routing settings for the task. A specific type of task goes to one queue and all the other tasks goes to another queue. Now I want to verify it is working or not.
For this, I want to inspect which tasks went to which queue. Unfortunately, I didn't find anything which could help me on this. celeryev monitor just provides information about which tasks have been received and what is their completion status. rabbitmqctl gives me information about the current running and waiting tasks only - so I cannot see to which queue did my intended task go to.
Could anyone help me with this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您通常无法使用 AMQP 检查队列上的消息(但不确定 Celery 是否如此)。
如果您只需要将此作为一次性测试,最简单的方法可能是用 Python 编写一个快速程序,从队列中获取所有消息并将其打印出来。
使用py-ampqlib,应该可以做到:
如果您需要更多帮助,这是一个好地方Ask 是 RabbitMQ Discuss 邮件列表。 RabbitMQ 开发人员尽力回答那里发布的所有问题,Celery 的作者也阅读了它。
You normally can't inspect messages on a queue with AMQP (not sure about Celery, though).
If you just need this as a one-off test, the simplest way would probably be to write a quick program in Python that gets all messages from the queues and prints them out.
Using py-ampqlib, this should do it:
If you need more help, a good place to ask is the RabbitMQ Discuss mailing list. The RabbitMQ developers do their best to answer all the questions posted there, and Celery's author also reads it.