Sunday, November 6, 2011

AMQP provider RabbitMQ

When we think of introducing advanced messaging to the enterprise and realize that this new technology may become the backbone of our enterprise we get a little concerned about issues like scalability, performance, stability, maturity of the product and its history in other enterprises.

We need the message bus to never fail, be blisteringly fast and to have proven itself in large industries.
RabbitMQ fits the bill.  It is used by Google, Mozilla, NASA as well as various financial institutions.  You can see here a list of companies using RabbitMQ.

RabbitMQ is built using Erlang.  Erlang is a language developed by Ericsson to, and I quote them here: 
'Build massively scalable, soft real-time systems with requirements on high availability'
In addition to Erlang, there are a set of libraries called OTP (Open Telecom Platform) that have also been developed in Erlang.  The types of applications Erlang/OTP is particularly suited for are Distributed, reliable, soft real-time concurrent systems.  A number of telecommunications companies use Erlang as does Facebook.  Facebook for example uses Erlang for their Chat backend.

VMWare - Cloud Foundry - vFabric:

Rabbit Technologies developed RabbitMQ and was recently bought by VMWare. VMWare has included the RabbitMQ application in their cloud solution called 'Cloud Foundry' or vFabric.

Rabbit technologies, by developing AMQP using Erlang has done a great job in creating a message bus that is highly stable and massively scalable.  Exactly what we need as our enterprise backbone.
RabbitMQ has another great feature, it's free.

If you're interested, you can read more here:

RabbitMQ Dowload
RabbitMQ Installation
VMWare vFabrid
AMQP Users

If you've chosen to install RabbitMQ on your own hardware, you'll also need management software.  There are a number of Nagios plugins that can be used to monitor your RabbitMQ installation, but RabbitMQ also comes with it's own management plugins.  You can find them here
RabbitMQ Management Plugins

I personally like the Management Visualizer, it allows you to visualize the topography of connected exchanges and queues.

Installing is a breeze, each plugin is compiled to the latest version and all it takes is to copy the plugins to the RabbitMQ plugin directory (rabbitmq_server_<version number>/plugin).

The installation and configuration instructions are located on two different pages, it's best to have both open in separate tabs/windows.

plugin installation instructions
management configuration

The management plugins make use of the mochiweb web-server and it defauls to port 55672, so if you already have another web-server installed on the machine and it's listening to the default http port (80) they should not interfere with each other.  I installed mine on a windows 2008 R2 web-server and they both worked at the same time.

you then have to remove the rabbitmq service, install the plugins and start the rabbitmq service again.
Like so:

rabbitmq-service.bat remove 

rabbitmq-service.bat install 

rabbitmq-service.bat start
then, add yourself as a user and give yourself the administrator role like so.

rabbitmqctl.bat add_user (username) (password)
rabbitmqctl.bat set_user_tags (username) administrator

To also be able to manage exchanges, queues and bindings you have to give yourself some additional priveledges.

rabbitmqctl.bat set_permissions (username) ".*" ".*" ".*"

there are three levels to the permissions - Config Write and Read
for each level you can enter a regular expression matching the object names the user can configure, write or read.  For an administrator, that would be all and the ".*" regular expression matches all names.

Now you can open your favorite browser and enter http://localhost:55672/mgmt/ and you'll see the below and you'll be able to manage all aspects of your RabbitMQ installation.

No comments:

Post a Comment