Please go to Burrow.NET repository on GitHub for latest source version and documents.



This project is created based on the idea of EasyNetQ, since Mike Hadlow used MIT licence, I hope he doesn't mind when I use his source code in this project. Again, Codeplex doesn't like WTFPL, so I have to choose MIT because it's the simplest one.

I was so lucky to have 2 chances to work with RabbitMQ in my 2 recent projects. EasyNetQ is the library I looked into at first place. Honestly, It's a good implementation, the author covered all problems he got with RabbitMQ and I learnt from that as well. However, I created this project for below reasons:
  • I need an easier way to define Exchange names and Queue names since I don't like the IConvention in EasyNetQ.
  • I need Fanout Exchange and I don't need the library to create Exchange/Server automatically which EasyNetQ is doing. Indeed, EasyNetQ creates Exchange type Direct everytime a message is published. Not sure if it could affect performance or not but It will throw exception because there is an existing Exchange with same name but different type defined manually. And furthur more, there is no way to override that behavior. Hmmm OCP problem :D
  • I want the messages to be consumed parallel. EasyNetQ has a method that looks like it consumes the messages asynchornous but sadly it consume one by one.
  • I need more flexibilities to inject behaviors for logging, error handling, object serializing, etc
  • And I want to be busy.

Alright, to publish a message, you just need something like:
var tunnel = TunnelFactory.Create();
tunnel.Publish(new OrderDetail
{	
    Name = "IPad 3",
    Color = "Black",
    Amount = 1	
});
To subscribe:
var tunnel = TunnelFactory.Create();
tunnel.SubscribeAsync<OrderDetail>("SubscriptionKey", msg =>
{
    // Process message here
});

// or subscribe synchronously:
tunnel.Subscribe<OrderDetail>("SubscriptionKey", msg =>
{
    // Process message here
});
Ofcourse you're gonna need a connection string to RabbitMQ server, exchange and queue defined to make it work. Please go to document page for more details how to run the test project.

Cheers

Last edited Mar 16, 2012 at 3:39 AM by nvthoai, version 5