Enforcement of best practices

Component: NServiceBus
NuGet Package NServiceBus (7.2-pre)
This page targets a pre-release version and is subject to change prior to the final release.

By default, messaging best practices are enforced for messages defined as either commands or events.

In NServiceBus versions 6 and above, the default behavior can be overridden.

To disable this feature at the endpoint level using:

7.x - 7.1 NServiceBus
var transport = endpointConfiguration.UseTransport<TransportName>();
var routing = transport.Routing();
routing.DoNotEnforceBestPractices();

or at the message level using:

7.x - 7.1 NServiceBus
var options = new SendOptions();

options.DoNotEnforceBestPractices();

await context.Send(new MyEvent(), options)
    .ConfigureAwait(false);

Last modified