Class RetryErrorPolicyBuilder
Builds the RetryErrorPolicy.
Inherited Members
Namespace: Silverback.Messaging.Configuration
Assembly: Silverback.Integration.dll
Syntax
public class RetryErrorPolicyBuilder : ErrorPolicyBaseBuilder<RetryErrorPolicyBuilder>
Constructors
RetryErrorPolicyBuilder()
Builds the RetryErrorPolicy.
Declaration
public RetryErrorPolicyBuilder()
Properties
This
Gets this instance.
Declaration
protected override RetryErrorPolicyBuilder This { get; }
Property Value
| Type | Description |
|---|---|
| RetryErrorPolicyBuilder |
Overrides
Remarks
This is necessary to work around casting in the base classes.
Methods
BuildCore()
Builds the error policy instance.
Declaration
protected override ErrorPolicyBase BuildCore()
Returns
| Type | Description |
|---|---|
| ErrorPolicyBase | The error policy. |
Overrides
WithExponentialDelay(TimeSpan, double, TimeSpan?)
Specifies an initial delay before the first retry and a factor to be applied to the delay at each retry.
Declaration
public RetryErrorPolicyBuilder WithExponentialDelay(TimeSpan initialDelay, double delayFactor, TimeSpan? maxDelay = null)
Parameters
| Type | Name | Description |
|---|---|---|
| TimeSpan | initialDelay | The initial delay before the first retry. |
| double | delayFactor | The factor to be applied at each retry. |
| TimeSpan? | maxDelay | The maximum delay to be applied. |
Returns
| Type | Description |
|---|---|
| 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.
Declaration
public RetryErrorPolicyBuilder WithIncrementalDelay(TimeSpan initialDelay, TimeSpan delayIncrement, TimeSpan? maxDelay = null)
Parameters
| Type | Name | Description |
|---|---|---|
| TimeSpan | initialDelay | The initial delay before the first retry. |
| TimeSpan | delayIncrement | The increment to be added at each subsequent retry. |
| TimeSpan? | maxDelay | The maximum delay to be applied. |
Returns
| Type | Description |
|---|---|
| RetryErrorPolicyBuilder | The policy builder so that additional calls can be chained. |
WithInterval(TimeSpan)
Specifies the interval between retries.
Declaration
public RetryErrorPolicyBuilder WithInterval(TimeSpan interval)
Parameters
| Type | Name | Description |
|---|---|---|
| TimeSpan | interval | The interval between retries. |
Returns
| Type | Description |
|---|---|
| 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.
Declaration
public RetryErrorPolicyBuilder WithMaxRetries(int retries)
Parameters
| Type | Name | Description |
|---|---|---|
| int | retries | The number of times this policy should be applied. |
Returns
| Type | Description |
|---|---|
| RetryErrorPolicyBuilder | The policy builder so that additional calls can be chained. |