New .NET/C# client library for RabbitMQ

This page is a mirrored copy of an article originally posted on the LShift blog; see the archive index here.

We’ve just finished and released our .NET/C# client library for AMQP. We developed it on Mono, and made sure it ran on the Microsoft .NET stacks as well - versions 1.1 and 2.0. There’s also a WCF binding, for exposing WCF-based services over AMQP. (The WCF binding only compiles and runs on the Microsoft CLR implementations, until Mono’s Olive WCF implementation matures a little, anyway.)

One interesting thing about the library is its support for more than just one protocol variant: it speaks AMQP 0-8 as standardised, AMQP 0-8 as extended by QPid, and AMQP 0-9 as standardised (sans the bits of the spec marked “work in progress”, ie. the Message class). You can switch protocol variants at runtime, and there’s a common interface that abstracts away from the incompatibilities in the protocol variants. We’ve run the library against RabbitMQ (of course), as well as QPid-java and OpenAMQ 1.2c4.

The library is documented in a PDF user guide, which actually contains quite a bit of useful general AMQP information and guidelines, and could form the core of a language-neutral RabbitMQ manual. The detailed API guide is also available - you can download the code, the binaries, and all the different reformattings of the documentation on the interim page for the .NET/C# client library.

Our RabbitMQ website is starting to look a bit messy, so we’re working on a revised layout that should be a bit tidier; then, the .NET stuff will be presented alongside all the other client libraries and bindings we have available, rather than being presented as a separate-looking piece.


On 31 January, 2008 at 2:05 am, Tom wrote:

Are you are planning any PHP libraries?

I have not heard of a PHP API to AMQP yet, and I think it would be interesting. I’ve looked at making bindings between a C library to PHP, but many of the C libraries do tricky things behind the scenes, like create and manage threads. That doesn’t play well, when the library is linked into PHP, and then the whole thing is loaded into Apache.

On 31 January, 2008 at 1:31 pm, tonyg wrote:

We’ve no plans right now to develop an AMQP PHP client. One thing that might be of interest is connecting to RabbitMQ using our experimental STOMP adapter plugin, with the PHP STOMP client (which I haven’t tried, but which looks pretty good). If this interests you, please get in touch!

On 1 February, 2008 at 9:47 am, Tom wrote:

Where could I get the Stomp adapter?

On 2 February, 2008 at 1:07 am, tonyg wrote:

Hi Tom - I’ve just made it available. Please see this post for a quick summary of compiling and running the extension. If you use mercurial, you can get a checkout of the code with “hg clone http://www.lshift.net/~tonyg/hg/hgwebdir.cgi/rabbitmq-stomp/“.