RabbitMQ 

Original address : https://baijiahao.baidu.com/s?id=1577456875919174629&wfr=spider&for=pc

Latest version RabbitMQ There are four switch types , Namely Direct exchange、Fanout exchange、Topic exchange、Headers exchange.

Direct Exchange

Process routing key . You need to bind a queue to the switch , Requires that the message exactly match a specific routing key . It's a complete match . If a queue is bound to the switch, a routing key is required “abc”, Only marked as “abc” The message was forwarded , Don't forward abc.def, It doesn't forward dog.ghi, Will only forward abc.

 

Fanout Exchange

Do not process route keys . You just need to simply bind the queue to the switch . A message sent to the switch is forwarded to all queues bound to the switch . It's very much like a subnet broadcast , The host in each subnet gets a copy of the message .Fanout Switches forward messages the fastest .

 

Topic Exchange

Match the routing key to a pattern . At this point, the queue needs to be bound to a mode . Symbol “#” Match one or more words , Symbol “” Match no more than one word . therefore “abc.#” Can match to “abc.def.ghi”, however “abc.” It's only going to match “abc.def”.

 

Headers Exchanges

Do not process route keys . It depends on the headers Property to match . In the binding Queue And Exchange Specifies a set of key value pairs ; When a message is sent to RabbitMQ Will get the message headers And Exchange Match key value pairs specified when Binding ; If it matches exactly, the message will be routed to the queue , Otherwise, it will not be routed to the queue .headers Property is a key value pair , It can be Hashtable, The value of a key value pair can be of any type . and fanout,direct,topic The routing keys of all need to be in string form .

Matching rules x-match There are two types of :

x-match = all : Indicates that all key value pairs match to receive the message

x-match = any : Indicates that messages can be received as long as there is a key value pair match

RabbitMQ More articles about the four switch types

  1. 【RabbitMQ Study two 】RabbitMQ Four switch mode applications

    Environmental Science win7 rabbitmq-server-3.7.17 Erlang 22.1 One . Concept 1. Queues are used to store and forward messages temporarily . There are two types of queues , Real time queue and delay queue . Instant queues : Messages in the queue will be set up ...

  2. mysql Partition table 2 :MySQL The four partition types of the table are introduced

    One . What is table partitioning Generally speaking, a table partition is to partition a large table , It is divided into several small tables according to the conditions .mysql5.1 Support data table partition . Such as : A user table has more than 600 Ten thousand , Then, the table can be partitioned according to the storage date , You can also partition the table according to the location ...

  3. RabbitMQ 7、 ... and : Switch type Exchange Types--Fanout Introduce

    Preface Latest version RabbitMQ There are four switch types , Namely Direct exchange.Fanout exchange.Topic exchange.Headers exchange. Before that, we used ...

  4. python Four numerical types (int,long,float,complex) Introduce

    Python Four different numerical types are supported , Include int( Integers )long( long integer )float( Floating point actual values )complex ( The plural ), This article introduces python Four numerical types , If you need a friend, please refer to it . Digital data ...

  5. MySQL Four partition types of tables

    MySQL Four partition types of tables One . What is table partitioning Generally speaking, a table partition is to partition a large table , It is divided into several small tables according to the conditions .mysql5.1 Support data table partition . Such as : A user table has more than 600 Ten thousand , Then the table can be changed according to the date of receipt ...

  6. C++ The difference between the four types of transformation in

    One . Comparison of four types of transformation : Type conversions have c Style , Of course, c++ Style .c The format of style conversion is very simple (TYPE)EXPRESSION, however c There are many disadvantages in style conversion , Sometimes I use c The change of style is not appropriate , Because it can ...

  7. HTTP Agreed 8 Two types of requests

    HTTP Agreed 8 Two types of requests from :http://www.cnblogs.com/liangxiaofeng/p/5798607.html HTTP Agreed 8 Two types of requests HTTP There are eight definitions in the agreement ...

  8. ASP.NET MVC There are four filter types

    stay ASP.NET MVC There are four filter types

  9. Delphi Four Boolean types are defined in :Boolean,ByteBool,WordBool and LongBool. The last three Boolean types are introduced for compatibility with other languages

    bool yes LongBool type . Delphi Four Boolean types are defined in :Boolean,ByteBool,WordBool and LongBool. The last three Boolean types are introduced for compatibility with other languages , In general, it is suggested that ...

Random recommendation

  1. And Python Falling In Love_Python Step by step ( object-oriented )

    Lesson two will introduce Python The use of some variables in . list . Tuples . Dictionaries and other details ... There will be more space ... So in the process of sorting out ... Skip lesson two first ... Come straight to lesson three ..Python Object oriented learning in and with mysql data ...

  2. BitMap Sort

    Problem description :       BitMap Sequencing ideas :             use 1bit Bit marks the value of an element       advantage :             Efficient , Comparisons and shifts are not allowed            ...

  3. solve IllegalStateException: Can not perform this action after onSaveInstanceState:

    Today, Alipay functions in the project , Is in fragment In the do , After the payment is successful , Want to switch to the payment success page . It turned out to be a mistake IllegalStateException: Can not perform this act ...

  4. iOS Memory management series 2 : Automatic release and convenient method

    Sometimes when an owner creates an object , A pointer to the object is immediately passed to the other owner . At this time , The creator doesn't want to have this object anymore , But if you send it one right away release The message causes the object to be immediately released —— So the other owners haven't come yet ...

  5. elasticsearch2.3.3 The cluster builds the pit

    This article comes from my github pages Blog http://galengao.github.io/ namely www.gaohuirong.cn Abstract : The environment that the author originally built is 0.95 edition Now upgrade to 2.3.3 edition , ...

  6. Judge the current Activity Is it at the top of the stack

    lockAppName It's a matter of judgment Activity Full name ( Include package name ). private boolean getTopApp(Context mContext) { String lockAppName ...

  7. 3D Print GCODE Document learning ( One )

    My family has a Tianwei entry-level 3D The printer . It has a supporting software called “Rrint-RiteCoLiDo Repetier-Host V1.5.5”, Used to connect . Control the printer . At the same time, it can load all kinds of slicing software , For all kinds of 3D Model ...

  8. 【Spring】19、spring Configure the 4 Ways of planting

    No matter what Persistence technology is used , You need to define data sources .Spring Provided in 4 There are two different forms of data source configuration : spring The data source that comes with it (DriverManagerDataSource),DBCP data source ,C3P0 data source ...

  9. Putty Usage of

    The general contents are listed as follows : ·         Simplest use , Sign in  SSH host ·         Chinese garbled code processing ·        PuTTY Description of common configurations ·         Copy . Paste ·         preservation ...

  10. ASP.NET Comparison of various ways to download files : Impact on performance 、 Support for large files 、 Support for breakpoint continuation and multi thread download

    asp.net There are many ways to , Write file stream from server to client , Realize the client to download files . This kind of technology is more useful in anti download system . The main technologies are :WriteFile.TransmitFile and BinaryWrite ...