Basic Concepts of RabbitMQ

Overview

In this article, we will get an overview of the common term used in RabbitMQ Server.

Commonly Used Terms in RabbitMQ

Producer

- Application that sends the messages

Consumer

- Application that receives the messages

Queue

- Buffer that stores messages

Message

- Data sent from producer to consumer through RabbitMQ

Connection

- TCP connection between the application and the RabbitMQ broker

Channel

- A virtual connection inside a connection. When publishing or consuming messages or subscribing to a queue, it’s all done over a channel.

Exchange

- Receives messages from producers and pushes them to queues depending on rules defined by the exchange type. A queue needs to be bound to at least one exchange to be able to receive messages.

Binding

- Link between a queue and an exchange.

Routing Key

- The key that the exchange looks at to decide how to route the message to queues. Think of the routing key as the destination address of a message.

AMQP

- Advanced Message Queuing Protocol - the primary protocol used by RabbitMQ for messaging.

Users

- It’s possible to connect to RabbitMQ with a given username and password, with assigned permissions such as rights to read, write, and configure. Users can also, be assigned permissions to specific virtual hosts.

Vhost

- Virtual host or Vhost segregate applications that are using the same RabbitMQ instance. Different users can have different access privileges to different vhosts and queues, and exchanges can be created so that they only exist in one vhost.

Like it’s possible to create different databases within a MySQL (database) server for different projects, vhost makes it possible to separate applications on one single broker. Isolate users, exchanges, queues, etc.

Acknowledgments and Confirms

- Indicators that messages have been received or acted upon. Acknowledgments can be used in both directions; for example, a consumer can indicate to the server that it has received/processed a message, and the server could report the same thing to the producer.