Table of Contents

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

RetryErrorPolicyBuilder

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

initialDelay TimeSpan

The initial delay before the first retry. Must be greater than Zero.

delayFactor double

The factor to be applied at each retry. Must be greater than zero.

maxDelay TimeSpan?

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

initialDelay TimeSpan

The initial delay before the first retry. Must be greater than Zero.

delayIncrement TimeSpan

The increment to be added at each subsequent retry. Must be greater than Zero.

maxDelay TimeSpan?

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

interval TimeSpan

The interval between retries. Must be greater than Zero.

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

retries int

The 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.