rabbitMQ several models

RabbitMQ provides four Exchange moment wire, said sub (exchange) mode: fanout Buddha downtown special (breakdown), direct drop soft Côte (lineal), topic he accompany grams (theme), header foolish knife (head).

A. Fanout Exchange (switching mode disaggregated)

  

  

  All messages sent to Fanout (Buddha downtown special) Exchange (moment wire, said sub) messages will be forwarded to all the Exchange Queue bindings (Binding) of.

  Fanout Exchange no need to process RouteKey (path key). Simply queue will be bound to the exchange. Thus the message sent to the exchange will be forwarded to all queues bound with the switch. Similarly subnet broadcast, the hosts in each subnet have received a copy of the message.

  So, Fanout Exchange forwards the message is the fastest.

Two. Direct Exchange (direct mode)

  

  All messages sent to Direct (soft drops may peach) message is forwarded to the Exchange RouteKey specified Queue.

  Direct mode, you can use rabbitMQ comes Exchange: default Exchange. The Exchange does not need to make any binding (binding) operation. When messaging, RouteKey must match exactly, will be a queue to receive, otherwise the message will be discarded.

 三. Topic Exchange

  All messages sent to Topic Exchange message is forwarded to all concerned RouteKey specified on the Topic of the Queue,

  Exchange will RouteKey a Topic and fuzzy matching. At this queue you need to bind a Topic. You can use wildcards fuzzy matching, the symbol "#" matches one or more words, the symbol "*" matches a word. So "log. #" Can be matched to "log.info.oa", but "log. *" Only matches to "log.error".

 

Guess you like

Origin www.cnblogs.com/liuyakun/p/11068911.html