How can I list or discover queues on a RabbitMQ exchange using python?(如何使用 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 交换中的队列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何使用 python 列出或发现 RabbitMQ 交换中的队列
基础教程推荐
- 在 Python 中将货币解析为数字 2022-01-01
- 究竟什么是“容器"?在蟒蛇?(以及所有的 python 容器类型是什么?) 2022-01-01
- Python,确定字符串是否应转换为 Int 或 Float 2022-01-01
- matplotlib 设置 yaxis 标签大小 2022-01-01
- Python 中是否有任何支持将长字符串转储为块文字或折叠块的 yaml 库? 2022-01-01
- 比较两个文本文件以找出差异并将它们输出到新的文本文件 2022-01-01
- 在 Django Admin 中使用内联 OneToOneField 2022-01-01
- 对多索引数据帧的列进行排序 2022-01-01
- kivy 应用程序中的一个简单网页作为小部件 2022-01-01
- Kivy 使用 opencv.调整图像大小 2022-01-01
