Excited by ZeroMQ

ZeroMQ looks like an interesting project. It's a light-weight messaging stack, supporting point-to-point, publish-subscribe and other topologies, without a broker.

ZeroMQ aims to sit at a slightly higher level than raw sockets. It's easy to write a socket "Hello World" server and client. The server prints whatever it receives, and the client connects to the server and emits "Hello World". Scaling up to real world needs is hard though. Sockets tend to fall over. Messages certainly will be fragmented. Your socket may be handling several clients at the same time. Messaging layers such as ZeroMQ aim to provide an abstraction, so you can put a string or an object in one end, and have it come out the other with minimal fuss.

In the past, I've looked at ActiveMQ, and RabbitMQ. Both seemed interesting, although as I understand it, both require a broker i.e. a server. This is fine for enterprises, the main target of messaging systems to date, but a little trickier for an individual - sure you can run a broker on your machine, but it's just something to be down at inopportune moments.

As far as I can see ZeroMQ is to Active/RabbitMQ as SQLite is to MySQL or PostgreSQL. You can embed ZeroMQ in your applications, and get the benefit, but the user doesn't have to care, and critically, doesn't have to run a server on their desktop.

And I think that having personal message systems on the desktop is exciting. I already have one, sort of, kind of. Growl is an application that sits in the background listening for "messages". Various applications support growl to pop up status messages. So when a friend comes online, Growl pops up a bubble to notify me. Or when various things update. It's a nice and useful program, but it's not really a messaging system - the "messages" are one-way, and do one thing: pop up on the screen.

A real messaging system goes further. One program could listen for a certain type of message to pass on to Growl. My servers could send messages detailing their status. A third could monitor those messages to check whether limits were breached, and send messages for Growl if so. A library for Excel could monitor messages, and give the latest value for various things, even updating in real-time, allowing quick-and-easy status board. Messages could be sent for stock and other financial data.

People are already doing all of this, of course. But you need to be an enterprise, or prepared to act like one, to use an enterprise messaging system. ZeroMQ will bring the bar down, and in the past, when that's happened, there have always been exciting new products. I hope I've given some, but, as usual, I expect the most exciting new uses will be the ones that we can't even see at the outset.

I've been playing a little with ZeroMQ at weekends, and in a future post, I'll describe how to install ZeroMQ, and give some simple examples of how to use it.

 

While I'm talking about messaging, I'd like to give a quick mention to the Fudge messaging project who are building libraries to support a slick binary format for encoding messages.