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

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.

主站蜘蛛池模板: 鄂伦春自治旗| 佛山市| 宜兰县| 沅江市| 泰宁县| 密山市| 大兴区| 尼木县| 大悟县| 阿拉善右旗| 托克托县| 天镇县| 吉隆县| 望奎县| 织金县| 沛县| 舟曲县| 简阳市| 青冈县| 陆川县| 铜山县| 汉川市| 赞皇县| 峡江县| 望奎县| 松滋市| 乌拉特后旗| 呼图壁县| 阿拉善盟| 伊金霍洛旗| 临泉县| 鹤壁市| 通渭县| 内江市| 乐东| 晋城| 浑源县| 开阳县| 大渡口区| 休宁县| 蛟河市|