问题描述
RabbitMQ 是否在以下情况下轮询分发消息?
Does RabbitMQ do round robin distribution of messages in following situation ?
RabbitMQ 配置:
- 交换类型 - 主题
- 路由键 - 通知.#
生产者正在将消息推送到上面的交换中,并带有以下内容不同的主题-
Producer is pushing the message to above exchange with followingdifferent topics-
notify.log.#、notify.status.#、notify.priceChange.#
notify.log.# , notify.status.#, notify.priceChange.#
有 4 个消费者在不同的服务器上运行.
There are 4 consumers are running on different servers.
3 个消费者在负载均衡器下执行相同的处理并在同一应用程序的不同实例上运行.(他们希望消费生产者推送的每条消息)
3 consumers are doing the same processing and running on different instance of same application under a load balancer.(They want to consume every message pushed by producer)
他们正在收听notification_queue";附有路由键notify.#".
They are listening to "notification_queue" attached with routing key "notify.#".
剩下的第 4 个消费者正在做一些与前 3 个消费者不同的处理,并在不同的服务器(不同的应用程序)上运行.
Remaining 4th consumer is doing some different processing than first 3 consumers and running on different server(of different application).
它正在收听log_queue";附有路由键notify.log.#".
It is listening to "log_queue" attached with routing key "notify.log.#".
RabbitMQ 是否会以循环方式在前 3 个消费者中分发消息(在第 1 点)?
Will RabbitMQ distribute message in round robin fashion in first 3 consumers(in point 1)?
请帮忙.
推荐答案
的确,消费者来源的意义何在.当我们在同一个队列上有多个消费者时,分发是循环的,你可以在模拟器中尝试一下 http://试试rabbitmq.com/
Yes indeed , does not matter what is the point of a origin of consumer . When we have multiple consumers on the same queue then the distribution is round robin , you can try it out in the simulator here http://tryrabbitmq.com/
这篇关于RabbitMQ:消息的循环分发与单队列的主题交换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!