Skip to content

Latest commit

 

History

History

docs

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

Configuration

Mattox.NServiceBus endpoints can be configured through the Microsoft.Extensions.Configuration. All settings are defined in the NServiceBus:EndpointConfiguration section. Different endpoints supporting different transport may define additional settings. Refer to the endpoint-specific documentation for more details.

Root section: NServiceBus:EndpointConfiguration.

Endpoint name

  • EndpointName configures the endpoint name. This setting is mandatory unless specified through the endpoint class constructor.

SendOnly

  • SendOnly (True/False, defaults to False) configures the endpoint as a send only endpoint.

Installers

Section full name: NServiceBus:EndpointConfiguration:Installers

Startup diagnostics

Section full name: NServiceBus:EndpointConfiguration:Diagnostics

Auditing

Section full name: NServiceBus:EndpointConfiguration:Auditing

The Auditing section allows controlling the endpoint audit capability.

  • Enabled (True/False, defaults to True) allows enabling or disabling the endpoint auditing functionalities. By default, NServiceBoXes endpoints have auditing enabled.
  • AuditQueue defines the audit queue name; if omitted, a default value of audit is used.

Recoverability

Section full name: NServiceBus:EndpointConfiguration:Recoverability

The Recoverability section allows controlling the endpoint recoverability capability.

  • ErrorQueue defines the error queue name; if omitted, a default value of error is used.

Immediate retries

Section full name: NServiceBus:EndpointConfiguration:Recoverability:Immediate

The Recoverability Immediate sub-section allows controlling immediate retry settings:

  • NumberOfRetries defines the number of times a failing message is retried immediately without delay.

Delayed retries

Section full name: NServiceBus:EndpointConfiguration:Recoverability:Delayed

The Delayed sub-section allows controlling delayed retry settings:

  • NumberOfRetries defines the number of times a failing message is retried in a delayed fashion.
  • TimeIncrease (format: TimeStamp) defines how much delay is used between delayed retries

Automatic Rate Limiting

Section full name: NServiceBus:EndpointConfiguration:Recoverability:AutomaticRateLimiting

The AutomaticRateLimiting section allows configuring the endpoint automatic rate limiting feature.

  • ConsecutiveFailures defines the number of failure that trigger the rate limiting feature
  • TimeToWaitBetweenThrottledAttempts (optional, format: TimeSpan, defaults to 1 second) defines the time to wait between throttled attempts.

It's also possible to define code callbacks that will be triggered when rate limiting starts and ends:

endpoint.Recoverability.OnRateLimitStarted(token => Task.CompletedTask);
endpoint.Recoverability.OnRateLimitEnded(token => Task.CompletedTask);

snippet source | anchor

To intercept and customize failed messages before they are sent to the configured error queue, use the following code:

endpoint.Recoverability.OnFailedMessage(settings =>
{
    settings.HeaderCustomization(headers =>
    {
        // Customize failed message headers
    });
});

snippet source | anchor

To take full control over how the endpoint treats failed message, it's possible to register a custom recoverability policy:

endpoint.Recoverability.UseCustomRecoverabilityPolicy(((config, context) =>
{
    // Use the configuration and the context
    // to decide how to handle the failing message
    return RecoverabilityAction.ImmediateRetry();
}));

snippet source | anchor

Addressing

Section full name: NServiceBus:EndpointConfiguration

Transport

Section full name: NServiceBus:EndpointConfiguration:Transport

PurgeOnStartup

NOTE: It's suggested to not discard messages in production.

Transport Transaction

Concurrency level

  • MessageProcessingConcurrency (int, defaults to not set) sets the endpoint concurrency level that determines how many messages the endpoint processes in parallel.