Skip to content

Instantly share code, notes, and snippets.

@abdullin
Created June 20, 2011 16:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abdullin/1035950 to your computer and use it in GitHub Desktop.
Save abdullin/1035950 to your computer and use it in GitHub Desktop.
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