RabbitMQ is an open source message-broker that providesyour applications a common platform to send and receive messages, and your messages a safe place to live until received. RabbitMQ originally implemented the Advanced Message Queuing AMQ Protocol and has since been extended with plugin architecture to support streaming Text oriented Messaging protocol.
RabbitMQ works based on AMQP (Advanced Message Queuing Protocol). It integrates with Producer and Consumer. Producer is a program which produces the messages. Consumer is the program which receives the messages. An exchange is responsible for routing the message along with some additional data to different queues with the help of bindings and routing keys. A binding is a link between a queue and an exchange.

Why use RabbitMQ?
- RabbitMQ is a messaging broker – an intermediary for messaging. It gives your applications a common platform to send and receive messages, and your messages a safe place to live until received.
- RabbitMQ enables asynchronous processing, meaning that it allows you to put a message in a queue without processing it immediately.
- The use of Message Queues provides a way for parts of the application to push messages to a queue asynchronously and ensure they are delivered to the correct destination. To implement message queuing, a message broker like RabbitMQ is a good option. The message broker provides temporary message storage when the receiving service is busy or disconnected.
Key Terminology:
- Producer: Producing means nothing more than sending. A program that sends messages is a producer.
- Consumer: Consuming has a similar meaning to receiving. A consumer is a program that mostly waits to receive message.
- Queue: It consists of actual data.
- Exchanges:
- Direct Exchange (routing key = binding key)
- Fanout Exchange (route message to all queues)
- Topic Exchange (partial match its match to exact binding also and * also)
- Headers Exchange (message header instead of routing key)
- Default Exchange (routing key = queue name, No explicit action can be performed on default)

Benefits of RabbitMQ:
- Data Flow: RabbitMQ uses a distinct, bounded data flow. Messages are created and sent by the producer and received by the consumer.
- Data Usage: RabbitMQ is best for transactional data, such as order formation and placement, and user requests.
- Messaging: RabbitMQ sends messages to users. These messages are removed from the queue once they are processed and acknowledged
- Design Model: RabbitMQ employs the smart producer/dumb consumer model. The producer consistently delivers messages to consumers and keeps track of their status.
- Topology: RabbitMQ uses the exchange queue topology — sending messages to an exchange where they are in turn routed to various queue bindings for the consumer’s use.
RabbitMQ Use Cases:
Complex Routing: In microservices architecture, RabbitMQ can be our best choice as it allows routing messages among many consuming apps. Its consistent hash exchange enables load balancing across a distributed monitoring service. Alternate exchanges to route specific portions of events to specific services for A/B testing is also achieved using RabbitMQ
Legacy Applications: RabbitMQ can be deployed using available plugins (or building our own plugin) for connecting consumer apps to legacy apps. For example, JMS apps can communicate using Java Message Service (JMS) plug-in and JMS client library.
Conclusion:
RabbitMQ is lightweight, reliable, scalable and portable message broker. Cross language communication is possible and enables different parts of a system to communicate and perform operations asynchronously. Importantly, it provides a lightweight buffer which temporarily stores messages, and has endpoints that allow software components to connect to the queue in order to send and receive messages.
-Kiran Padwal
