RabbitMQ six operating modes

A language based on erlang: is a highly concurrent languages

RabbitMQ six operating modes:
1.1 simple simple mode

 

 

  1. § the message generating a message in the queue
  2. Consumers message (consumer) listen (while) the message queue, the queue if there are messages, they consumed, the message is taken away automatically deleted (hidden messages consumers may not be properly processed from the queue, the queue has been disappears, resulting in the loss) message scenarios: chat (over the middle of a server; p side, C side)
1.2 work the operating mode (competition for resources)

 

 

  1. Producers put a message on the message queue can have multiple consumers, consumers 1, 2 consumers, while monitoring the same queue, the message is the consumer? C1 C2 jointly fighting the current contents of the message queue, who is responsible for who should get consumer information (risk, high concurrency, will generate a default message is a common use of multiple customers, you can set a switch (syncronize, and synchronization lock is not the same performance) guarantee a message can only be used by a consumer)
  2. Scenario: red; resource scheduling large project (task allocation system does not need to know which system is idle task execution, the task directly thrown into the message queue, the system automatically scramble idle)
1.3 publish / subscribe publish-subscribe (shared resources)

 

 

  1. X represents a switch rabbitMQ internal components, Erlang code completion message is generated by performing code efficiency is not high, the message generated by the message into the switch, the switch sends a message to the publish subscribe to all the message queue, the message queue corresponding to the consumer to take message to the consumer
  2. Related scenario: bulk mail, group chat, broadcast (advertising)
1.4 routing routing mode

 

 

  1. Send a message to the message producer in accordance with the routing decision switch, a route (method objects) message string (info) currently generated character carrying route, according to the route of the key switch, only the key corresponding to the road matching message queue, the corresponding consumers can consume messages;
  2. The traffic routing function definition string
  3. Obtaining from the code string corresponding to the function logic of the system, the messages in the task queue corresponding thrown business scenario: error notification; the EXCEPTION; error notification function; traditional error notification; customer notification; use routing key may be errors in the program package to the incoming message to a message queue, a developer can customize the consumer, the real-time reception error;
1.5 topic theme (A route mode)

 

 

  1. Pound sign on behalf of a wildcard asterisk
  2. The asterisk represents more than one word, a word on behalf of the pound
  3. Routing feature to add fuzzy matching
  4. Message producer generates a message, the message to the switch
  5. Fuzzy matching key switch according to a rule corresponding to the queue, the queue receiving the message from the monitor consumer consumption
1.6RPC first no explanation

Reference document:. 1 https://blog.csdn.net/chou_out_man/article/details/79244019

Guess you like

Origin www.cnblogs.com/insane-Mr-Li/p/12532668.html