1. What is AMQP?
AMQP (Advanced Message Queuing Protocol) is a binary protocol with modern features. It is an application layer standard advanced message queuing protocol that provides unified messaging services. It is an open standard for application layer protocols and is designed for message-oriented middleware.
AMQP as a message, the products it implements are RabbitMQ, similar message protocols are JMS (Java Message Service) java message service, and JMS products implement ActiveMQ.
2. AMQP protocol model?
The following figure shows the message
flow of messages .
A message producer (Publisher application) sends a message to a switch (Exchange) on a virtual host (Virtual host) on the message middleware service (Server). Then the switch will be bound to a Message Queue. And our message consumer (Consumer application) gets the message directly from the message queue and consumes it.
3. The core concept of AMQP?
noun | description |
---|---|
Server | Also called Broker, it receives the client's connection and implements AMQP entity service |
Channel | Network channel, almost all operations are carried out in Channel. Channel is a channel for reading and writing messages. The client can establish multiple channels, each channel represents a session |
Connection | Connection, network connection between application and Server |
Message | The message, the data passed between the server and the application, consists of properties and body. Properties can modify the message, such as message priority, delay and other advanced features; body is the content of the message |
Virtual host | The virtual address is used for logical isolation and message routing at the uppermost layer. There can be multiple Exchanges and Queues in a Virtual host, and there cannot be Exchanges and Queues with the same name in the same Virtual host |
Exchange | The switch receives the message and forwards the message to the routing key |
Binding | Binding, virtual connection between Exchange and Queue, Binding can contain routing key |
Routing key | A routing rule that virtual machines can use to determine how to route a message |
Message Queue | Message queue, save messages and forward to consumers |
Fourth, the message exchange architecture
The AMQP protocol can support multiple message exchange architectures:
- Store-and-forward (multiple message senders, single message receivers)
- Distributed transactions (multiple message senders, multiple message receivers)
- Publish and subscribe (multiple message senders, multiple message receivers)
- Content-based routing (multiple message senders, multiple message receivers)
- File transfer queue (multiple message senders, multiple message receivers)
- Point-to-point connection (single message sender, single message receiver)