Messaging middleware rabbitmq for distributed systems

Since we want to do a distributed system, we have to say a distributed message communication system. The foundation of a distributed system is that each distributed unit can communicate with each other in various ways. The well-known open source implementations of distributed message middleware include rabbitMQ, zeroMQ (library), ActiveMQ, etc. This article first examines the famous message middleware rabbitmq

rabbitmq was acquired by SpringSource in April 2010, which is a division of vmware, which means that rabbitmq is now owned by vmware.

Rabbitmq is written in erlang language and implements the AMQP protocol. The AMQP protocol was developed by JPMorgan Chase Group and iMatix Corporation in mid-2004 to mid-2006, and was later maintained by the AMQP working group. Originally used in the financial field, it has slowly become a general protocol. Unlike JMS, AMQP defines a detailed message format, so software developed in any language can communicate with software developed in other languages, as long as their message formats are consistent.

The AMQP protocol defines Message Broker as a message server and User as a consumer (producer or consumer) of the message server. A physical connection Connection can be established between User and Message Broker. On Connection, a virtual connection channel can be created. Based on Channel, it is possible to declare (declare) the exchange exchange, the queue queue, and establish a binding binding between the exchange and the queue. The message is sent by the producer to the exchange, and then sent to the queue bound to the exchange according to the rules. The message is divided into a header and a message body. The header contains the routing-key, and the binding also has the attribute of the routing-key. However, this attribute of the binding can be one or more explicit routing-keys, or one or more specific routing-keys. Multiple patterns.

There can be multiple bindings between an exchange and a queue, an exchange can bind multiple queues, and a queue can also be bound to multiple exchanges. Here exchange is equivalent to a hardware switch, but queue is not a connection, but a cache, and binding is the relationship between queue and exchange. Although there can be multiple bindings between an exchange and a queue, it will not cause a message to be repeatedly sent from the exchange to the same queue, and a message will be sent from an exchange to a queue at most once.

binding is actually a configuration rule on exchange.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326990131&siteId=291194637