Skip to content

Instantly share code, notes, and snippets.

@benfoster
Created September 10, 2013 06:39
Show Gist options
  • Save benfoster/6505740 to your computer and use it in GitHub Desktop.
Save benfoster/6505740 to your computer and use it in GitHub Desktop.
Subscribing to NServiceBus 3.0 events from ASP.NET
private static IBus ConfigureBus()
{
return NServiceBus.Configure.With()
.DefaultBuilder()
.XmlSerializer()
.MsmqTransport()
.IsTransactional(false)
.PurgeOnStartup(true)
.UnicastBus()
.LoadMessageHandlers()
.CreateBus()
.Start(() => Configure.Instance.ForInstallationOn<Windows>().Install());
}
<!-- NServiceBus -->
<MessageForwardingInCaseOfFaultConfig ErrorQueue="error" />
<UnicastBusConfig ForwardReceivedMessagesTo="audit">
<MessageEndpointMappings>
<add Assembly="DocumentService.Messages.Commands" Endpoint="DocumentService.Host" />
<add Assembly="DocumentService.Messages.Events" Endpoint="Foo.Web" />
</MessageEndpointMappings>
</UnicastBusConfig>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment