One of my readers asked me to take a look at AMQP and RabbitMQ. Seemed right up my alley, so I did.
AMQP
Since some type of messaging/queuing requirement is becoming fairly commonplace today, we face the same problem we always face when different groups, who have adopted their own solution, want to start exchanging data with other groups, who may have chosen their own solution. AMQP (you can read all about it here) is a public specification for messaging/queuing, a wonderful idea, has a meaningful and robust spec, and is being used all over the world in a couple of prevalent offerings. Let’s look at the predominant offering in that space today.
RabbitMQ
I really like RabbitMQ’s tagline on their website, “Messaging that just works.” The sounds pretty cool. Why? Because I’ve not only implemented various messaging platforms but have also designed and engineered one of our own (for very high speed point to point messaging – when Selero was young and we wrote it all ourselves). And because of that experience, I know that installing, configuring, integrating and reliably running a message platform hasn’t always been that easy. So I was still grinning a bit when I hit this gem on RabbitMQ’s website:
Downloading and Installing RabbitMQ
Our goal is to streamline the broker installation process such that you can have RabbitMQ up and running within two minutes of completing your download. If this doesn’t happen to you, please let us know at legitimategrievance@rabbitmq.com!
I thought to myself, “Self, they’re really laying this down – so let’s see!” I downloaded the package which included the examples for .NET; unzipped it to a directory; set my ERLANG_HOME equal to the right directory (more on that later). Then, expecting to see many error codes and anticipated hours of exchanging email with RabbitMQ’s support department, I double-clicked on the server batch file.
It ran. Without any problems. But it was still early to start sending “kudo’s” to the RabbitMQ team – we had to see if we could use the broker.
Examples
Lots of examples are included with RabbitMQ – and getting them up and running was very straightforward – like typing in the executable name with the correct command line arguments and pressing enter easy. The first two examples I ran were AddServer and AddClient. And they worked too. I was getting ready to send kudo’s.
One last thing though – I wanted to try the WCF examples included with the .NET client distribution. And that worked too. Kudo’s to the RabbitMQ team.
RabbitMQ and CEP
Before diving into the CEP realm, I did go back and run all of the demos and the server with the newest version of Erlang – 5.7.4. RabbitMQ’s download is bundled with an older version. And everything worked just fine. Again.
In the current world of CEP, the ‘run your app on one big honkin’ machine with lots of cores’ is prevalent. In this example, you’ve still got to get data in and out of the engine. And all of the vendors supply their own client API’s for both out-of-process and in-process communication. So where would I use RabbitMQ? In this example, using RabbitMQ makes sense for a couple of things:
- I like the built in request/reply semantics found in AMQP and RabbitMQ. This makes it very easy to simulate synchronous calls to services out on the network. And there’s a lot of examples found not only on RabbitMQ’s website for this, but out in the net in general. These services can even be embedded within the RabbitMQ server. I like this because in some of the CEP products, it’s difficult to do traditional, procedural stuff sometimes (there’s a reason we’re not seeing a lot of CEP in fixed income, for example). This is a drawback of using SQL-like languages and why more than a couple of vendors have augmented their DSL’s with additional, procedural extensions.
- Many times, the data that you need to stuff into your CEP engine is only accessible via custom, vendor specific, api’s – like Reuter’s RFA 6 for example. In this case, you’re going to either build or buy an adapter from the vendor. But let’s say that you don’t need that custom API, and you don’t want to pay for additional uses (cores) of that particular message transport, then using RabbitMQ makes a lot of sense. I really like the use of pub/sub and think it makes a lot of sense, and that we’ll see more of it as CEP solutions are deployed more outside of the traditional consumption of market data, computation of signals, and subsequent order placement.
In the coming world of clustered deployment of CEP services, the use of RabbitMQ makes even more sense. RabbitMQ supports a number of messaging scenarios and could be used for command/control/monitoring of the grid without running into exorbitant licensing scenarios (one messaging vendor I dealt with when helping the rebuild of the Boston Stock Exchange wanted to charge for each client of the exchange – each end user! ). RabbitMQ could also be used for the scenarios described above.
Conclusion
RabbitMQ’s claims on their website are correct. And refreshing in the world we live in today. I downloaded the software, installed it, and it ran as advertised. The client libraries are pervasive with API’s available for Java, .NET, Ruby, Python, the list goes on, and of course, Erlang. Also, I did have a couple of questions during my evaluation and RabbitMQ’s staff were not only available, but quick to answer. I like that. If you haven’t given RabbitMQ and AMQP a try, do so. And if you’re using RabbitMQ in a CEP deployment, I’d love to hear about it.
Post Script
I’m not going to talk about benchmarks – I did all of this ‘work’ on my laptop, our other machines are busy exploring the far reaches of the universe (DarkStar), and messaging benchmarks are fairly meaningless unless you’re looking at a very specific examples.