|
|
Introduction
Starting with release 0.2, MassTransit integrates the use of an Inversion of Control container for configuration. A generic IObjectBuilder interface has been added to allow the use of different containers. By default, a Castle Windsor facility is available to ease deployment when used in that environment.
Details
To configure MassTransit for use in your application with Castle Windsor, the following configuration is available within the facility section of the Castle.xml:
<facility id="masstransit">
<bus id="local" endpoint="msmq://localhost/test_servicebus">
<subscriptionCache mode="local" />
<subscriptionService endpoint ="msmq://localhost/mt_pubsub" />
<managementService endpoint ="msmq://localhost/mt_dashboard" />
</bus>
<bus id="distributed" endpoint-"msmq://localhost/test_remoteservicebus">
<subscriptionCache mode="distributed">
<servers>
<server>192.168.0.1:11211</server>
<server>192.168.0.2:11211</server>
</servers>
</subscription>
</bus>
<transports>
<transport>MassTransit.ServiceBus.MSMQ.MsmqEndpoint, MassTransit.ServiceBus.MSMQ</transport>
<transport>MassTransit.ServiceBus.NMS.NmsEndpoint, MassTransit.ServiceBus.NMS</transport>
</transports>
</facility>Elements
bus
Each bus element is an instance of IServiceBus. In fact, that is the only element that is required for an isolated service bus to be created by the facility.
subscriptionCache
The subscription cache can be either local or distributed depending upon the model being used for this service bus instance.
For local subscription caches, an optional name can be specified. If a name is specified, a shared instance of the cache is created that can be used by multiple instances of the service bus.
For a distributed subscription cache, the servers that are running memcached must be specified as shown.
Sign in to add a comment
