Search code examples
.netmsmqnservicebus5

How to get NServiceBus SLR working with MsmqPersistence


I have created a Windows Console app to test NServiceBus v5.2.16. I am using MsmqPersistence. FLR works when messages fail to be processed on the receiver. However, SLR does not kick in once FLRs have been tried.

The FLR and SLR are defined according to the guidelines and are as follows:

<TransportConfig MaxRetries="5" />
<SecondLevelRetriesConfig Enabled="true" TimeIncrease="00:00:10" NumberOfRetries="3" />

And this is how I start the service bus:

    static void Main(string[] args)
    {
        Console.Title = "CRM Sub Test";

        var busConfiguration = new BusConfiguration();
        busConfiguration.EndpointName("TestQueue");
        busConfiguration.UsePersistence<MsmqPersistence>();
        busConfiguration.EnableInstallers();

        using (var bus = Bus.Create(busConfiguration).Start())
        {
            Console.WriteLine("Press any key to exit");
            Console.ReadKey();
        }
    }

Any help is greatly appreciated

Regards


Solution

  • This was answered in Google Groups here. TLDR version: MSMQ Persistence works with subscriptions only and it's not scalable. MSMQ Persistence does not support timeout storage which is required for second-level retries. NHibernate or RavenDB persistence are more suitable for that.