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.
delayFactordoubleThe factor to be applied at each retry.
maxDelayTimeSpan?The maximum delay to be applied.
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.
delayIncrementTimeSpanThe increment to be added at each subsequent retry.
maxDelayTimeSpan?The maximum delay to be applied.
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
intervalTimeSpanThe interval between retries.
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.
Returns
- RetryErrorPolicyBuilder
The policy builder so that additional calls can be chained.