Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Sample of registering routing dispatcher with custom quarantine (Lokad.CQRS v2.0)
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