Iâ€™ve been reading several blogs about event-driven/event broker/message bus. I have used the Castle Windsor EventWiringFacility which allows you to setup a component to publisher with subscribers defined either in the xml or through the windsor fluent interface. I have blogged about that here.
Taking this a step further is the concept of an event â€˜brokerâ€™ or â€˜message busâ€™ â€“ where messages are published to the broker that then can send these to subscribers (in a publish-subscriber setup) without setting up delegates/events for the publisher. One such message bus available in .net is â€˜Mass Transitâ€™.
MassTransit is lean service bus implementation for building loosely coupled applications using the .NET framework.
The lean implementation is supported by the YAGNI principle. By focusing on a tight set of specific concerns, the touch points between Mass Transit and the application are minimized resulting in a clear and concise set of interfaces.
Mass Transit offers a â€˜how to get startedâ€™ example that shows how rather easy it is to get this setup. In this example it uses Castle Windsor.
Iâ€™m a tad bias (lol) toward Castle Windsor, as I find it easy to setup and use, and quite powerful. The community offers several options, in this case, Mass Transit has started with Castle Windsor and provides a good set of examples to get started. Using an IoC container makes it very easy to register components to be used by the message bus.
The next step will be create a sample with a test to get this rollingâ€¦ off I go, to the Mass Transit wiki to get it all set upâ€¦
Edit: a good â€˜how to get msmq installedâ€™:
Then, ‘setting up the â€˜standard-servicesâ€™ for Mass Transitâ€™:
Also, a â€˜Using the host serviceâ€™ –
The Host service allows the easy configuration of a Windows service for handling messages on the service bus