I would like to be able to have my subscriber handling two different streams of messages. I am expecting there will be a MSMQ queue for each message type, but I don't see how to specify more than one InputQueue in the MsmqTransportConfig section in my .config file.
Here is the no-XML configuration for my subscriber:
Configure.With(new[] { typeof(EventMessage), typeof(EventMessageHandler), typeof(NServiceBus.Unicast.Transport.CompletionMessage) })
.CustomConfigurationSource(new UserConfigurationSource()
.Register(() => new MsmqTransportConfig { InputQueue = "Subscriber1InputQueue", ErrorQueue = "error", NumberOfWorkerThreads = 1, MaxRetries = 5 }))
.DefaultBuilder()
.XmlSerializer()
.MsmqTransport()
.IsTransactional(true)
.UnicastBus()
.DoNotAutoSubscribe()
.LoadMessageHandlers()
.CreateBus()
.Start();
EDIT: I seem to be getting different answers from different folks. Thanks everyone! I think I have the answer to my question and that is: A process using NServiceBus (whether publisher or subscriber) can only receive messages on a SINGLE queue. To me, this is an unnecessary limitation, and it's unfortunate that NServiceBus works this way. I don't want to have multiple processes for receiving messages, and I don't want to have them all going to the same queue. If there is a problem with a particular message handler, I would like to see only the error queue for that particular message type grow in size. I think it would allow for better visibility into what's going on in the system.