RabbitMQ follows the AMQP (Advanced Message Queueing Protocol) specification.
AMQP defines 3 components:
- Exchange - components that routes messages to queues
- Queue - stores messages
- Binding - rule that tells the exchange which queue to route a particular message
The flow of data is: Application -> RabbitMQ -> Exchange -> Queue
Binding (also called binding keys) will be used by Exchange to evaluate routing keys of each message and decide the target queue.
- can one message directed to multiple queues?
RabbitMQ supports binding of Exchange to Exchange in addition of Exchange to Queue.
All commands in RabbitMQ are sent in a common data structure "Frame".
A frame has 5 parts:
- Frame type
- Channel number
- Frame size in bytes
- Frame payload
- End-byte marker
- what does "channel" means?
There are 5 frame types:
- Protocol header frame - used only once when connecting to RabbitMQ
- Method frame - RPC request or response that's being sent/received from RabbitMQ
- Content header frame - containers the size and properties for a message
- Body frames - contain the contents of messages
- Heartbeat frame - ensure both sides are working
- 1 method
- 1 content
- 1 or more body