RequirementsAssemblies Needed To Get StartedMassTransit.ServiceBus.dll
MassTransit.ServiceBus.MSMQ.dll An IoC Container is requiredWe currently have support for Castle, and StructureMap with Ninject on the way. We are going to use Castle's WindsorMassTransit.WindsorIntegration.dll
Castle.Core.dll
Castle.MicroKernel.dll
Castle.Windsor.dll
Castle.DynamicProxy2.dll Read up on configuring Castle whew! Once all of this is set up you can use typical IoC programming patterns to get access to the ServiceBus instance, or you can pull it out of the container like so. IServiceBus bus = container.Resolve<IServiceBus>(); How to subscribe to a messageMT has 2 different ways to subscribe to messages in 0.2 bus.Subscribe(Of T)(component as T)
bus.AddComponent(Of T) We will get into what we mean by component in just a bit TBD: What is a component How to publish a messageIServiceBus bus = container.Resolve<IServiceBus>();
bus.Publish(new MyMessage); How to build a message[Serializable]
public class YourMessage
{
//put your stuff here
//this message should be an *immutable*
//value object so use readonly fields
//and readonly properties - 1
}1. Greg Young on Messages are Value Objects
|