如何使用python在RabbitMQ交换上列出或发现队列? [英] How can I list or discover queues on a RabbitMQ exchange using python?

查看:131
本文介绍了如何使用python在RabbitMQ交换上列出或发现队列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要有一个python客户端,该客户端可以在重新启动的RabbitMQ服务器交换上发现队列,然后启动一个客户端以恢复使用每个队列中的消息.如何从某些RabbitMQ兼容的python api/库中发现队列?

I need to have a python client that can discover queues on a restarted RabbitMQ server exchange, and then start up a clients to resume consuming messages from each queue. How can I discover queues from some RabbitMQ compatible python api/library?

推荐答案

据我所知,没有任何方法可以做到这一点.与Python无关,但是因为AMQP没有定义任何队列发现方法.

As far as I know, there isn't any way of doing this. That's nothing to do with Python, but because AMQP doesn't define any method of queue discovery.

在任何情况下,在AMQP中,都是由客户端(消费者)声明队列的:发布者使用路由密钥将消息发布到交换机,而使用者确定这些路由密钥进入哪个队列.因此,在没有消费者的情况下谈论队列是没有意义的.

In any case, in AMQP it's clients (consumers) that declare queues: publishers publish messages to an exchange with a routing key, and consumers determine which queues those routing keys go to. So it does not make sense to talk about queues in the absence of consumers.

这篇关于如何使用python在RabbitMQ交换上列出或发现队列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆