Introduction to RabbitMQ
RabbitMQ is one of the most widely used open-source message brokers. It was originally based on the Advanced Message Queuing Protocol (AMQP). Later on, it has been modified to support Message Queuing Telemetry Transport (MQTT), Streaming Text Oriented Messaging Protocol (STOMP), and several other common protocols. RabbitMQ has been designed to be used for a variety of messaging scenarios that have developed over the last 25 years. It is well-known for Reliability and Interoperability. It has been implemented in many languages; therefore, it is one of the best choices for building reliable, large scale, clustered, resilient messaging infrastructure.
What is RabbitMQ?
It is a traditional messaging broker that supports many messaging protocols like AMQP, MQTT, and STOMP and is also called the hybrid broker. It supports several variations of pub-sub, points to point, request-reply messaging techniques. It uses a smart broker/dumb consumer model and focused on delivering messages to consumers consistently. It offers great performance if configured properly, supports client libraries in Java, Ruby, .NET, PHP and many other languages, and offers several plugins that can be added to extend use cases and integration scenarios. It offers both synchronous and asynchronous modes of communication.
RabbitMQ supports a variety of acknowledgements for different use cases and supports transactions across messaging queues. It also allows segregation of the various transactional semantics (if required). It also allows distributed transactions like X/Open XA transactions. It also supports message grouping and idempotent messages. It supports a lot of fine-grain control in terms of accessing queues. One can restrict access to certain queues, manage the depth and a lot more.
Operations and Security are areas of strength for RabbitMQ. RabbitMQ management plugin offers browser-based UI for monitoring and management, and HTTP UI, and CLI tools for operations. In addition to TLS support, RabbitMQ comes with RBAC having a built-in data store, LDAP or external HTTPS-based providers.
Why We Use RabbitMQ?
RabbitMQ is a messaging broker widely used to get quick responses from web servers instead of performing resource-intensive operations, which keeps the user waiting for results. It is also suitable for distributing messages among more than one consumer or load balancing among consumers under high load.
Following are some scenarios where one would prefer using RabbitMQ:
- Your application needs to use a combination of different messaging protocols like STOMP, AMQP, MQTT, etc.
- It would help if you had finer and more consistent control on a per-message basis.
- Your application needs more than one messaging technique like pub/sub, point to point, request/reply, etc.
- It is useful when we need to run the same job on a specific server, group of servers or all servers. The application sends one message, and exchange will route it. This is possible due to the powerful routing capability of RabbitMQ.
- If you need to integrate your messaging broker with existing IT infrastructure, RabbitMQ is the one to go with.
RabbitMQ can also be used with Cassandra (No-SQL) if your application is required to run on stream history, and you can also use LevelDB plugin if your application needs to use Infinite Queue.
What Can We do with RabbitMQ?
Messaging allows applications to connect and scale-up. Applications can connect to one another, as parts of a larger application, or end-users’ devices and data. RabbitMQ is a messaging broker- an intermediate entity for messaging. It provides a common platform for your applications to send and receive messages and a safe place for your messages to live until consumed.
It offers the following features:
- Reliability: It offers a number of features that allow you to trade off performance with reliability, delivery acknowledgements, including persistence, high availability, and publish confirms.
- Flexible Routing: Messages arrive at exchanges and then routed to queues. RabbitMQ offers a number of predefined exchanges for various use cases. You can define more complex routing by binding exchanges together or defining your own exchange-type as a plugin.
- Clustering: Two or more RabbitMQ servers that are on the local network can be clustered together, forming a single large broker.
- Federation: For some use cases, servers need to be unreliably and loosely connected than allowed by clustering. RabbitMQ offers a federation model for such cases.
- Highly Available Queue: Queues can be replicated across several nodes of the cluster, which ensures that messages are safe even in the case of hardware failure.
- Multi-Protocol: RabbitMQ supports several of the messaging protocols.
- Management-UI: RabbitMQ comes equipped with an easy to use Management UI that helps in smooth control and monitoring of every aspect of the broker.
- Tracing: In case the system misbehaves, RabbitMQ offers to trace support to find out what is breaking the system.
- Plugin System: RabbitMQ comes with varieties of plugins, and you are also allowed to write a custom plugin to meet requirements.
RabbitMQ is widely used in the industry as it supports complex-routing. It has been adopted by many big companies/organizations like JP Morgan, NASA (for Nebula Cloud Computing), and Google. In fact, it also finds usage in India’s Aadhar Project, which is the largest biometric database in the world.
This is a guide to What is RabbitMQ. Here we discuss why we use RabbitMQ and what we can do with it, and the features. You may also have a look at the following articles to learn more –