Stage 5 3. Micro Services [studies] _day05 online messaging middleware RabbitMQ_13.RabbitMQ research - work mode -header and rpc operating mode

header mode

header pattern different from that where routing, header mode is canceled routingkey, using the header of the key / value (key-value pairs) match
queue.
Case:
according to the user's notification settings to notify the user, set to receive Email user receives only Email, users set to receive sms receive sms only, set two
the two types of notification types of notifications are received are valid.






Transmission data

when transmitting the two transmission key / value pairs then the above will be receiving two queues.

RPC


I.e., the client RPC method call a remote service terminal, may be implemented using asynchronous RPC call MQ realized based Direct switch process is as follows:
1, that is, the producer client is the consumer, to RPC RPC call message sending request queue, while monitoring RPC response queue.
2, the server listens RPC request message queue, the method of performing server after receiving the message, and the results returned by the method
3, the server sends the result RPC method to RPC response queue
4, the client (RPC caller) monitor RPC response queue, receives the call result RPC.





 

Guess you like

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