Enforcement of best practices

Component: NServiceBus | Nuget: NServiceBus (Version: 6.x)

By default messaging best practices are enforced for messages defined as either Commands or Events.

In Versions 6 and above the default behavior can be overridden.

To disable this feature at the endpoint level using:

Edit
var transport = endpointConfiguration.UseTransport<TransportName>();
var routing = transport.Routing();
routing.DoNotEnforceBestPractices();

or at the message level using:

Edit
var options = new SendOptions();

options.DoNotEnforceBestPractices();

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

Last modified