I'm fairly new to NServiceBus and I've got a question.
I have a WCF service that is my publisher (I know I shouldn't use publish by wcf). I have another WCF service as subscriber.
My problem is that, when second wcf service is going to subscribe to publisher, my publisher doesn't store this information in msmq (when using .MsmqSubscriptionStorage()). But it works when publisher stores subscribers in memory (.InMemorySubscriptionStorage())
How to force my bus to use msmq?
Below I'll give code of publisher and subscriber.
Publisher bus initialization:
Bus = NServiceBus.Configure.WithWeb()
.DefaultBuilder()
.XmlSerializer()
.MsmqTransport()
.IsTransactional( false )
.PurgeOnStartup( false )
.UnicastBus()
.LoadMessageHandlers()
.ImpersonateSender( false )
.MsmqSubscriptionStorage()
.CreateBus()
.Start(() => Configure.Instance.ForInstallationOn<NServiceBus.Installation.Environments.Windows>().Install());
Publishers config:
<configSections>
<section name="MessageForwardingInCaseOfFaultConfig" type="NServiceBus.Config.MessageForwardingInCaseOfFaultConfig, NServiceBus.Core" />
<section name="UnicastBusConfig" type="NServiceBus.Config.UnicastBusConfig, NServiceBus.Core" />
<section name="MsmqTransportConfig" type="NServiceBus.Config.MsmqTransportConfig, NServiceBus.Core" />
</configSections>
<MessageForwardingInCaseOfFaultConfig ErrorQueue="error"/>
Subscribers bus init:
Bus = NServiceBus.Configure.WithWeb()
.DefaultBuilder()
.XmlSerializer()
.MsmqTransport()
.IsTransactional(false)
.PurgeOnStartup(false)
.UnicastBus()
.ImpersonateSender(false)
.LoadMessageHandlers()
.CreateBus()
.Start(() => Confgure.Instance.ForInstallationOn<NServiceBus.Installation.Environments.Windows>().Install());
Subscribers config:
<configSections>
<section name="UnicastBusConfig" type="NServiceBus.Config.UnicastBusConfig, NServiceBus.Core" />
<section name="MessageForwardingInCaseOfFaultConfig" type="NServiceBus.Config.MessageForwardingInCaseOfFaultConfig, NServiceBus.Core" />
<section name="MsmqTransportConfig" type="NServiceBus.Config.MsmqTransportConfig, NServiceBus.Core" />
</configSections>
<MessageForwardingInCaseOfFaultConfig ErrorQueue="error"/>
<UnicastBusConfig>
<MessageEndpointMappings>
<add Messages="Messages" Endpoint="FirstService" />
</MessageEndpointMappings>
</UnicastBusConfig>