We have an ASP.NET MVC application that currently sends commands to a NServiceBus (v3) service.
The service publishes events that we need to subscribe to within the web application so that we can display real time notifications to our users.
The bus is currently initialised as below within the web application:
private static IBus ConfigureBus()
{
return NServiceBus.Configure.With()
.DefaultBuilder()
.XmlSerializer()
.MsmqTransport()
.IsTransactional(false)
.PurgeOnStartup(true)
.UnicastBus()
.LoadMessageHandlers()
.CreateBus()
.Start(() => Configure.Instance.ForInstallationOn<Windows>().Install());
}
With the following configuration in web.config:
<!-- NServiceBus -->
<MessageForwardingInCaseOfFaultConfig ErrorQueue="error" />
<UnicastBusConfig ForwardReceivedMessagesTo="audit">
<MessageEndpointMappings>
<add Assembly="Foo.DocumentService.Messages" Endpoint="Foo.DocumentService.Host" />
</MessageEndpointMappings>
</UnicastBusConfig>
However, the event handler I have created within the web application is not invoked, no queue is created for the web application and I don't see any subscription messages sent to the host.
Am I missing something?
IEvent
or follow a convention? – Chris Bednarski