Class RetryErrorPolicyBuilder
- Namespace
- Silverback.Messaging.Configuration
- Assembly
- Silverback.Integration.dll
Builds the RetryErrorPolicy.
public class RetryErrorPolicyBuilder : ErrorPolicyBaseBuilder<RetryErrorPolicyBuilder>
- Inheritance
-
RetryErrorPolicyBuilder
- Inherited Members
Constructors
RetryErrorPolicyBuilder()
public RetryErrorPolicyBuilder()
Properties
This
Gets this instance.
protected override RetryErrorPolicyBuilder This { get; }
Property Value
Remarks
This is necessary to work around casting in the base classes.
Methods
BuildCore()
Builds the error policy instance.
protected override ErrorPolicyBase BuildCore()
Returns
- ErrorPolicyBase
The error policy.
WithExponentialDelay(TimeSpan, double, TimeSpan?)
Specifies an initial delay before the first retry and a factor to be applied to the delay at each retry.
public RetryErrorPolicyBuilder WithExponentialDelay(TimeSpan initialDelay, double delayFactor, TimeSpan? maxDelay = null)
Parameters
initialDelayTimeSpanThe initial delay before the first retry. Must be greater than Zero.
delayFactordoubleThe factor to be applied at each retry. Must be greater than zero.
maxDelayTimeSpan?The maximum delay to be applied. If specified, must be greater than Zero.
Returns
- RetryErrorPolicyBuilder
The policy builder so that additional calls can be chained.
WithIncrementalDelay(TimeSpan, TimeSpan, TimeSpan?)
Specifies an initial delay before the first retry and an increment to be added at each subsequent retry.
public RetryErrorPolicyBuilder WithIncrementalDelay(TimeSpan initialDelay, TimeSpan delayIncrement, TimeSpan? maxDelay = null)
Parameters
initialDelayTimeSpanThe initial delay before the first retry. Must be greater than Zero.
delayIncrementTimeSpanThe increment to be added at each subsequent retry. Must be greater than Zero.
maxDelayTimeSpan?The maximum delay to be applied. If specified, must be greater than Zero.
Returns
- RetryErrorPolicyBuilder
The policy builder so that additional calls can be chained.
WithInterval(TimeSpan)
Specifies the interval between retries.
public RetryErrorPolicyBuilder WithInterval(TimeSpan interval)
Parameters
Returns
- RetryErrorPolicyBuilder
The policy builder so that additional calls can be chained.
WithMaxRetries(int)
Sets the number of times this policy should be applied to the same message in case of multiple failed attempts.
public RetryErrorPolicyBuilder WithMaxRetries(int retries)
Parameters
retriesintThe number of times this policy should be applied. Must be greater than or equal to 1.
Returns
- RetryErrorPolicyBuilder
The policy builder so that additional calls can be chained.