Stage 5 3. Micro Services [studies] _day05 online messaging middleware RabbitMQ_7.RabbitMQ Research - operating mode - Work Queue Mode


RabbitMQ has the following operating modes:
. 1, Work Queues
2, the Publish / the Subscribe
. 3, the Routing
. 4, Topics
. 5, Header
. 6, the RPC

1、Work queues

 

work queues compared with the entry procedures, more than a consumer side, two common consumer end consumer with a message in the queue.
Scenario: too heavy for the task or tasks in many cases, the use of the work queue can improve the speed of processing tasks.
Test:
1, Getting Started, launch multiple consumers.
2, a plurality of producers transmit messages.
Results:
1, a received message will only be a consumer;
2, Rabbit way polling message is sent to the average consumer;
3, a consumer after handling messages, will receive the next messages.

A producer more consumers. Simultaneously process multiple message consumers embodiment, the cyclic polling message sent to the respective consumer
 

test

More consumers start


to start the three, the equivalent of three consumers to listen to the same queue.


We can see a total of three links

Run producer


of a consumer receives a message

a second client reception

Repeatedly turns each consumer receives a message sent

Guess you like

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