Book Image

RabbitMQ Essentials

By : David Dossot
Book Image

RabbitMQ Essentials

By: David Dossot

Overview of this book

Table of Contents (17 chapters)

The RabbitMQ broker


RabbitMQ is an Erlang implementation of an AMQP broker. Erlang has been chosen to build it because of its intrinsic support for building highly-reliable and distributed applications. Indeed, it is used to run telecommunication switches for which a proverbial total system's availability of 9 nines has been reported (that's 32 milliseconds of downtime per year). Erlang is also able to run on any operating system.

RabbitMQ implements Version 0-9-1 of AMQP with custom extensions (as allowed by the protocol) and some undeprecations (for features RabbitMQ really wants to keep). For data persistence, it relies on Mnesia, the in-memory/file-persisted embedded database of Erlang, and specific message storage and index files. For clustering, it mainly relies on Erlang's ingrained clustering abilities. RabbitMQ can easily be extended with the addition of plugins; for example, a web-based administration console can be deployed on it, thanks to this mechanism. This is shown in the following diagram:

The RabbitMQ broker engaging in various topologies

As shown in the preceding figure, RabbitMQ brokers can not only be clustered together, they can also be connected together using different techniques, such as federation and shovels, in order to form messaging topologies with smart message routing across brokers and the capacity to span multiple data centers.

Note

What's the deal with AMQP 1.0?

AMQP 1.0 was published at the end of 2011 after the development and maintenance of AMQP was transferred to OASIS. Why hasn't RabbitMQ rushed to support this version, since it seems to be the first official release? The fact of the matter is that AMQP has been drastically revised between 0-9-1 and 1.0. It was so drastic that some core concepts, such as the exchange, no longer exist. So, AMQP 1.0 is a different protocol than 0-9-1, with no truly compelling reason to adopt it. It is not more capable than 0-9-1, and some would also argue that it has lost some of the key aspects that made it attractive in the first place.

We're done with our quick introduction to messaging, AMQP, and RabbitMQ. In the next section, we will introduce Clever Coney Media, a fictitious company that just discovered RabbitMQ and will put it to service for the greater good!

A case for RabbitMQ

Clever Coney Media (CCM) is a fictitious integrated software and digital media agency that specializes in developing applications for online communities. Their software landscape, as shown in the following figure, is a hodgepodge of technologies:

  • Its flagship product is a Rich Internet Application (RIA), backed by a Java backend. It's used by end users to engage in thematic online communities.

  • The back office is built with Ruby on Rails.

  • The company's website and blog runs on PHP.

  • A bunch of ad hoc Python scripts are used to extract and message data in order to generate usage reports.

    Clever Coney Media's heterogeneous software landscape

You may wonder, why is CCM looking at adding RabbitMQ to their already busy environment? The main driver for this is a new feature it wants to offer to their users, which is the capacity to send messages to other users. Think of it as a mix of chat, without the immediateness, and e-mail, without the long-running history. Instead of creating its own messaging infrastructure, it's decided to use a ready-made message oriented middleware like RabbitMQ.

We'll see in the rest of the book that as its knowledge and usage of RabbitMQ increases, CCM will discover new opportunities to leverage it in its environment. But for now, enough with the ado; let's follow CCM as it gets started with its very first step with RabbitMQ.