Created
August 9, 2011 13:55
-
-
Save csharpfritz/1134105 to your computer and use it in GitHub Desktop.
MassTransit bus config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IUnityContainer _Unity = // blah blah blah... configured Unity elsewhere | |
Bus.Initialize(sbc => | |
{ | |
sbc.UseMsmq(); | |
sbc.VerifyMsmqConfiguration(); | |
sbc.UseMulticastSubscriptionClient(); | |
sbc.ReceiveFrom(queueName); | |
sbc.Subscribe( | |
subs => | |
{ | |
var types = | |
_Unity.Registrations.Where( | |
r => | |
r.MappedToType.GetInterfaces().Contains( | |
typeof (IConsumer))); | |
foreach (var reg in types) | |
{ | |
subs.Consumer(reg.MappedToType, t => _Unity.Resolve(t)); | |
} | |
} | |
); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment