I am just starting to play with nservice bus and am trying to get publishing working. I have a listener which seems to be missing some messages. It is configured with
<MsmqTransportConfig
InputQueue="InformMessages"
ErrorQueue="error"
NumberOfWorkerThreads="5"
MaxRetries="5"
/>
Interestingly if I set NumberOfWorkerThreads to 1 it consistently misses every other message. For larger values it seems less determinate. In my message handler I have
class MessageHandler : IMessageHandler<ICourseRegister>
{
public void Handle(ICourseRegister message)
{
Console.WriteLine("Message dun got gotted");
Console.WriteLine("Course name is: " + message.CourseName);
}
private IBus bus;
public IBus Bus
{
set { this.bus = value; }
}
}
and the bus is configured with
var bus = NServiceBus.Configure.With()
.SpringBuilder()
.XmlSerializer()
.MsmqTransport()
.IsTransactional(true)
.PurgeOnStartup(false)
.UnicastBus()
.ImpersonateSender(false)
.LoadMessageHandlers()
.CreateBus()
.Start();
Is there something I need to do and the end of Handler such that it is freed ready to receive the next message or some configuration I need to do so that there is a client side queue to retain messages if the handler is busy. The time between sending messages doesn't seem to matter, it could be 20 seconds and the listener still doesn't get all the messages.