我想在RabbitMQ中创建多个交换,并对每个交换有不同的回调。在本教程之后,我构建了一个异步使用者,但它只接受一种交换和队列。 https://gist.github.com/Enether/3fe8779a120e849b52c4160b376e68b8
创建多重交换的好方法是什么?在
我的想法是
例如
class OtherConsumerConnection(BaseRabbitMQConsumerConnection):
"""
This class defines the needed variables to establish a RabbitMQ connection
"""
EXCHANGE = 'other_exchange'
EXCHANGE_TYPE = 'fanout'
QUEUE = 'text'
ROUTING_KEY = 'example.text'
NotificationsConsumerConnection(RABBITMQ_CONNECTION_URL, handlers.first_handler).run()
OtherConsumerConnection(RABBITMQ_CONNECTION_URL, handlers.other_handler).run()
发出多个连接是个坏主意吗?正确的方法是什么?在
目前没有回答
相关问题 更多 >
编程相关推荐