Ayende @ Rahien

It's a girl

Setting up a Rhino Service Bus Application: Part II–One way bus

One really nice feature of Rhino Service Bus is the notion of the one way bus. What is that? It is a miniature implementation of the bus that supports only sending messages, not receiving them. In what world is this useful?

It turn out, it quite a few. One way bus is usually used for web apps that just send commands / events to another system, and have no need to interact with the bus other than that, or for command line tools that just send a message, etc. The advantage of the one way bus is that you don’t need your own endpoint to use it, you can just start it, send some messages, and go away.

Here is how you set it up. As usual, we start from the configuration (this assumes you have the Raven.ServiceBus.Castle nuget package):

<?xml version="1.0"?>
    <section name="rhino.esb" type="Rhino.ServiceBus.Config.BusConfigurationSection, Rhino.ServiceBus"/>
      <add name="HibernatingRhinos.Orders.Backend.Messages"

You might note that we don’t have any bus/endpoint configuration, only the list of message owners.

Now, the next step is just to create the actual one way bus:

var container = new WindsorContainer();
new OnewayRhinoServiceBusConfiguration()

var onewayBus = container.Resolve<IOnewayBus>();
onewayBus.Send(new TestMsg
    Name = “ayende”

And that is all…


Marcel Gosselin
12/03/2011 03:10 AM by
Marcel Gosselin

Did you mean Rhino instead of Raven in Raven.ServiceBus.Castle?

12/14/2011 07:03 PM by

I've been looking at the Rhino service bus and trying to get to grips with the basics first, one thing that our company is constrained by is the lack of "admin privileges" on a client machine to setup things like msmq, is it possible to swap the endpoints to be a DB queue table instead?

Ayende Rahien
12/15/2011 07:26 AM by
Ayende Rahien

Peter, You can use Rhino Queues so you don't need admin

12/15/2011 04:32 PM by

Excellent thank you Ayende, I'll start looking into them also :o)

Thank you for your assistance and your excellent blog and support to the community!

Comments have been closed on this topic.