Skip to content

Instantly share code, notes, and snippets.

@logicbomb
Created March 8, 2012 02:32
Show Gist options
  • Select an option

  • Save logicbomb/1998166 to your computer and use it in GitHub Desktop.

Select an option

Save logicbomb/1998166 to your computer and use it in GitHub Desktop.
// HOST INIT
Bus.Initialize(sbc =>
{
sbc.SetNetwork("my-technologies");
sbc.UseRabbitMq();
sbc.ReceiveFrom("rabbitmq://localhost/command_host");
sbc.SetPurgeOnStartup(true);
sbc.Subscribe(
s =>
{
registerCommandProcessors(container);
s.LoadFrom(_processors);
s.Handler<DiagnosticCommand>(msg =>
{
Bus.Instance.MessageContext<DiagnosticCommand>().Respond(new DiagnosticResponse());
this.Debug("Responding to DiagnosticCommand Request from {0}", msg.IssuedBy);
});
});
});
// PUBLISHER INIT
Bus.Initialize(sbc =>
{
sbc.SetNetwork("my-technologies");
sbc.UseRabbitMq();
sbc.ReceiveFrom("rabbitmq://localhost/publisher");
sbc.SetPurgeOnStartup(true);
sbc.Validate();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment