MSMQ Subscription Persistence

Source
NuGet Package NServiceBus (4.x)
Standard support for version 4.x of NServiceBus has expired. For more information see our Support Policy.
Storing subscriptions in MSMQ must not be used when scaling out across multiple machines or running side-by-side on the same machine. The subscription queue cannot be shared among multiple endpoints instances for the same endpoint.

To configure MSMQ as the subscription persistence:

configure.MsmqSubscriptionStorage();

By default, NServiceBus uses a queue called {Name of endpoint}.Subscriptions. In order to specify a different queue to store the subscriptions, add the following configSections and subsequent config entry:

<configuration>
  <configSections>
    <section name="MsmqSubscriptionStorageConfig"
             type="NServiceBus.Config.MsmqSubscriptionStorageConfig, NServiceBus.Core" />
  </configSections>
  <MsmqSubscriptionStorageConfig Queue="YourEndpointName.Subscriptions" />
</configuration>

Samples


Last modified