views:

412

answers:

4

Assuming a green field project, what choice of technologies, libraries, middleware, etc. would make it easiest to implement publish-subscribe messaging with durable subscriptions on Windows and .NET? I found WCF Peer Channel using Google, which seems to do most of what I need, but I do not think it guarantees message ordering, nor does it persist messages to disk for reliability. Microsoft says these capabilities can be layered on top, but I was looking for something that already has them.

MSMQ distrubution lists are close to what I want, but I would prefer something where the messaging layer did not have to know about all the clients up front.

The number of subscribers is not large, probably less than 20.

Both publishers and subscribers are implemented in C#/.NET and running on Windows.

EDIT: I am looking into the message-oriented middleware and service bus suggestions. I am familiar with the enterprise-y products in this space - am really looking for something simple and lightweight. It takes a while to look at each product, but I will try to summarize my findings.

A: 

Have you looked at RabbitMQ? Can't say I've had experience of it myself, but when the Rabbit guys gave a tech talk at work they seemed to know what they were talking about :)

Jon Skeet
+1  A: 

What about looking at a message bus type of architecture. There's several open source bus implementations that sit on top of MSMQ out there.

Using one of these libraries your service could publish "events" (messages) whenever it needed. At startup the server does not need any configuration telling it about clients ahead of time. As clients are started, they subscribe to a known server endpoint and from there the server publishes to them whenever it raises a message.

Jeremy Wiebe
A: 

Apache ActiveMQ also supports .NET (and many other languages). Open Source, and also available with commercial support.

http://activemq.apache.org

Easy to set up and configure. Automatic creation of message destinations. Supports peer-to-peer and publish/subscribe communication models.

mjustin
+2  A: 

I've done this exact same thing (publishers and consumers in C# on .Net), with large numbers of durable subscriptions, and I actually used SonicMQ for this. While it's billed as a JMS provider, it has pure .net client libraries that are quite similar to the JMS APIs that work exceptionally well.

I'm extremely familiar with RabbitMQ, and it currently doesn't support durable subscriptions if they run out of the memory space of the broker (so it can't really flow them to disk). It's an excellent solution for a case where your message flow (producers and consumers) all fit in memory, but not when you need a persistent durable subscription system.

As part of that project I evaluated ActiveMQ, Tibco EMS, and FioranoMQ, and SonicMQ was far and away the best solution, particularly with C# clients. It's pricey, but is well worth looking at.

Kirk Wylie