Created
June 20, 2011 16:33
-
-
Save abdullin/1035950 to your computer and use it in GitHub Desktop.
Sample of registering routing dispatcher with custom quarantine (Lokad.CQRS v2.0)
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
m.AddAzureProcess(config, IdFor.Publish, p => | |
{ | |
p.DispatcherIs( | |
(c, a, x) => | |
{ | |
// provided by the bus | |
var registry = c.Resolve<QueueWriterRegistry>(); | |
var streamer = c.Resolve<IEnvelopeStreamer>(); | |
// not provided by bus in v2.0 | |
var tapeWriter = c.Resolve<ITapeWriter>(); | |
// see https://gist.github.com/1035945 for an example | |
return new RoutingDispatcher(config.AccountName, registry, streamer, tapeWriter); | |
}); | |
p.DecayPolicy(TimeSpan.FromSeconds(0.75)); | |
// optional but recommended, see https://gist.github.com/1027419 for an example of this | |
p.Quarantine(c => new MailQuarantine(mail, c.Resolve<IStreamingRoot>())); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment