Im trying to setup an NServiceBus PubSub example which is hosted inside a set of windows services.
I have configured my publisher and can see it calling my buses publish method. Ive also configured a subscriber to listen to the messages i am sending. It appears however that the actual subscription process hasnt worked properly as i cant see a log message saying the subscriber has been subscribed (as i do in the PubSub sample).
Im just wondering if you need some kind of magic to make this work when hosting the service yourself.
below is my config
Publisher
App.Config
<configSections>
<section name="MsmqTransportConfig" type="NServiceBus.Config.MsmqTransportConfig, NServiceBus.Core" />
<section name="UnicastBusConfig" type="NServiceBus.Config.UnicastBusConfig, NServiceBus.Core" />
</configSections>
<!-- 1. In order to configure remote endpoints use the format: "queue@machine"
2. Input queue must be on the same machine as the process feeding off of it.
3. Error queue can (and often should) be on a different machine.
4. The community edition doesn't support more than one worker thread.
-->
<MsmqTransportConfig InputQueue="publisher.input" ErrorQueue="error" NumberOfWorkerThreads="1" MaxRetries="5" />
<UnicastBusConfig>
<MessageEndpointMappings></MessageEndpointMappings>
</UnicastBusConfig>
Bus Setup:
var bus = Configure.With()
.Log4Net()
.NinjectBuilder()
.XmlSerializer()
.MsmqSubscriptionStorage()
.MsmqTransport()
.IsTransactional(false)
.PurgeOnStartup(false)
.UnicastBus()
.ImpersonateSender(false)
.CreateBus()
.Start();
Subscriber
App.Config
<configSections>
<section name="MsmqTransportConfig" type="NServiceBus.Config.MsmqTransportConfig, NServiceBus.Core" />
<section name="UnicastBusConfig" type="NServiceBus.Config.UnicastBusConfig, NServiceBus.Core" />
</configSections>
<!-- 1. In order to configure remote endpoints use the format: "queue@machine"
2. Input queue must be on the same machine as the process feeding off of it.
3. Error queue can (and often should) be on a different machine.
4. The community edition doesn't support more than one worker thread.
-->
<MsmqTransportConfig
InputQueue="subscriber.input"
ErrorQueue="error"
NumberOfWorkerThreads="1"
MaxRetries="5"
/>
<UnicastBusConfig>
<MessageEndpointMappings>
<add Messages="MyEventNamespace" Endpoint="publisher.input" />
</MessageEndpointMappings>
</UnicastBusConfig>
Bus Setup:
var bus = Configure.With()
.Log4Net()
.NinjectBuilder()
.XmlSerializer()
.MsmqSubscriptionStorage()
.MsmqTransport()
.IsTransactional(false)
.PurgeOnStartup(false)
.UnicastBus()
.ImpersonateSender(false)
.CreateBus()
.Start();
Is there anything I'm missing or doing stupidly?
Cheers