官术网_书友最值得收藏!

The subscription ID that you pass to subscribe is important

EasyNetQ will create a unique queue on the RabbitMQ broker for each unique combination of message type and subscription ID. Each call to Subscribe creates a new queue consumer. If you call the Subscribe method two times with the same message type and subscription ID, you will create two consumers consuming from the same queue. RabbitMQ will then round-robin successive messages to each consumer in turn. This is great for scaling and work-sharing. Say you've created a service that processes a particular message, but it's getting overloaded with work. Simply start a new instance of that service (on the same machine, or a different one) and without having to configure anything, you get automatic scaling.

If you call the Subscribe method two times with different subscription IDs but the same message type, you will create two queues, each with its own consumer. A copy of each message of the given type will be routed to each queue, so each consumer will get all the messages (of that type). This is great if you've got several different services that all care about the same message type.

主站蜘蛛池模板: 田阳县| 工布江达县| 祁阳县| 金坛市| 阿拉尔市| 永春县| 哈密市| 高密市| 彭山县| 泽州县| 长岛县| 广汉市| 海林市| 灌云县| 海林市| 九台市| 诸暨市| 湘西| 张北县| 济南市| 合江县| 阆中市| 常德市| 宁乡县| 大丰市| 新民市| 宁乡县| 上虞市| 赤峰市| 宁河县| 西乡县| 明光市| 宜君县| 上犹县| 密云县| 丹寨县| 溧阳市| 阿瓦提县| 瓮安县| 安徽省| 南溪县|