Getting Started
Architecture
NServiceBus
Transports
Persistence
ServiceInsight
ServicePulse
ServiceControl
Monitoring
Samples

Configure immediate retries

Component: NServiceBus
NuGet Package: NServiceBus (8.1)
In order to get full control over Immediate Retries it is possible to override the default Recoverability Policy.
Immediate Retries cannot be used when transport transactions are disabled.

Configuring

  • NumberOfRetries: Number of times Immediate Retries are performed. Default: 5.
var recoverability = endpointConfiguration.Recoverability();
recoverability.Immediate(
    immediate =>
    {
        immediate.NumberOfRetries(3);
    });

Disabling

var recoverability = endpointConfiguration.Recoverability();
recoverability.Immediate(
    immediate =>
    {
        immediate.NumberOfRetries(0);
    });
Configuration through app.config, IProvideConfiguration or ConfigurationSource is not available in Versions 6 and above.

Samples