Amqp Model
Amqp has several important concepts
Producer: Message sender. Creates a message, fills in the message content (such as the routing Key), and sends the message to exchange.
Exchange: Receives messages from the producer and distributes messages to the corresponding Queue according to the configuration in bindings.
Bindings: Describes the relationship between exchange and queue. Exchange determines the queue to which the message is distributed based on the message content (routing key) and binding configuration.
Queue: Stores messages and passes them to the final consumer.
Consumer: The actual user of the message. A consumer can subscribe to multiple queue to receive messages in the queue.
Exchange type
Amqp exchange can be divided into the following types:
Direct is similar to express delivery in our life. Fill in the address of the other party. The Post Office will deliver the mail based on the unique address.
1) [Producer] In the message body, fill in the routing key2) [Exchange] based on the routing key, search for the queue3 bound to the routing key in the binding) [Exchange] to send the message to the queue
Topic exchange is similar to direct exchange, but topic Exchange supports fuzzy match (#, *, etc)
A topic is similar to a newspaper subscription in our life. After subscribing to a magazine using the keyword "Sports", the Post Office will send you "Sports Weekly" and "Sports Daily"
1) [Producer] In the message body, fill in the routing key2) [Exchange] According to the routing key, in the binding, through fuzzy match, find the queue3 bound to the routing key) [Exchange] Send a message to the queue
Fanout exchange does not require any routing keyfanout, which is similar to broadcasting in our daily life. Anyone who does not need to subscribe to it can listen to fanout exchange and send the message to all bound queue.
Basic knowledge about amqp in openstack Message Queue