Stage 5 3. Micro Services [studies] _day05 online messaging middleware RabbitMQ_10.RabbitMQ Research - operating modes - Route mode of presentation


RoutingKey queue can be specified at the time of the binding switches,

routing modes:
1, every consumer monitor their queue, and set routingkey.
2, the message to the switch manufacturer, by the switch to forward the message to a specified queue according routingkey.

For example, the following error is specified routingKey

following is provided a plurality of routingKey error info is a warrning there is a


role of routingKey, when the message is sent to the switch, you specify a routing key.
We assume in the message sent to the switch when the key is specified routing error, the corresponding error found above the switch queues are queues corresponding to the following, it will be sent to the message queue inside the two.

If the routing message key is specified info, then the following message will be sent to the queue. Only the following queue specified routing key contains info


model Routing can be implemented publish subscribe. Like routing key announcement specifies the error then will be sent simultaneously to the top of the queue and the next queue. So this is in fact achieved a publish and subscribe model.









 

Guess you like

Origin www.cnblogs.com/wangjunwei/p/11621692.html