Class ErrorPolicyChainBuilder
Builds the IErrorPolicy.
Implements
Inherited Members
Namespace: Silverback.Messaging.Configuration
Assembly: Silverback.Integration.dll
Syntax
public class ErrorPolicyChainBuilder : IErrorPolicyChainBuilder
Constructors
| Improve this doc View sourceErrorPolicyChainBuilder(IEndpointsConfigurationBuilder?)
Initializes a new instance of the ErrorPolicyChainBuilder class.
Declaration
public ErrorPolicyChainBuilder(IEndpointsConfigurationBuilder? endpointsConfigurationBuilder = null)
Parameters
Type | Name | Description |
---|---|---|
IEndpointsConfigurationBuilder | endpointsConfigurationBuilder | The optional reference to the IEndpointsConfigurationBuilder that instantiated the builder. |
Properties
| Improve this doc View sourceEndpointsConfigurationBuilder
Gets the IEndpointsConfigurationBuilder that instantiated the builder.
Declaration
public IEndpointsConfigurationBuilder? EndpointsConfigurationBuilder { get; }
Property Value
Type | Description |
---|---|
IEndpointsConfigurationBuilder |
Methods
| Improve this doc View sourceBuild()
Builds the IErrorPolicy instance.
Declaration
public IErrorPolicy Build()
Returns
Type | Description |
---|---|
IErrorPolicy | The IMessageSerializer. |
ThenMove(IProducerEndpoint, Action<MoveMessageErrorPolicy>?)
Adds a MoveMessageErrorPolicy that moves the messages that fail to be processed to the configured endpoint.
Declaration
public IErrorPolicyChainBuilder ThenMove(IProducerEndpoint endpoint, Action<MoveMessageErrorPolicy>? policyConfigurationAction = null)
Parameters
Type | Name | Description |
---|---|---|
IProducerEndpoint | endpoint | The endpoint to move the message to. |
Action<MoveMessageErrorPolicy> | policyConfigurationAction | The (optional) additional configuration. |
Returns
Type | Description |
---|---|
IErrorPolicyChainBuilder | The IErrorPolicyChainBuilder so that additional calls can be chained. |
ThenRetry(Action<RetryErrorPolicy>)
Adds a RetryErrorPolicy that retries to process the messages that previously failed to be to processed.
Declaration
public IErrorPolicyChainBuilder ThenRetry(Action<RetryErrorPolicy> policyConfigurationAction)
Parameters
Type | Name | Description |
---|---|---|
Action<RetryErrorPolicy> | policyConfigurationAction | The (optional) additional configuration. |
Returns
Type | Description |
---|---|
IErrorPolicyChainBuilder | The IErrorPolicyChainBuilder so that additional calls can be chained. |
ThenRetry(int, Action<RetryErrorPolicy>)
Adds a RetryErrorPolicy that retries to process the messages that previously failed to be to processed.
Declaration
public IErrorPolicyChainBuilder ThenRetry(int retriesCount, Action<RetryErrorPolicy> policyConfigurationAction)
Parameters
Type | Name | Description |
---|---|---|
int | retriesCount | The maximum number of retries to be performed. |
Action<RetryErrorPolicy> | policyConfigurationAction | The (optional) additional configuration. |
Returns
Type | Description |
---|---|
IErrorPolicyChainBuilder | The IErrorPolicyChainBuilder so that additional calls can be chained. |
ThenRetry(int, TimeSpan, Action<RetryErrorPolicy>)
Adds a RetryErrorPolicy that retries to process the messages that previously failed to be to processed.
Declaration
public IErrorPolicyChainBuilder ThenRetry(int retriesCount, TimeSpan initialDelay, Action<RetryErrorPolicy> policyConfigurationAction)
Parameters
Type | Name | Description |
---|---|---|
int | retriesCount | The maximum number of retries to be performed. |
TimeSpan | initialDelay | The optional delay to be applied to the first retry. |
Action<RetryErrorPolicy> | policyConfigurationAction | The (optional) additional configuration. |
Returns
Type | Description |
---|---|
IErrorPolicyChainBuilder | The IErrorPolicyChainBuilder so that additional calls can be chained. |
ThenRetry(int?, TimeSpan?, TimeSpan?, Action<RetryErrorPolicy>?)
Adds a RetryErrorPolicy that retries to process the messages that previously failed to be to processed.
Declaration
public IErrorPolicyChainBuilder ThenRetry(int? retriesCount = null, TimeSpan? initialDelay = null, TimeSpan? delayIncrement = null, Action<RetryErrorPolicy>? policyConfigurationAction = null)
Parameters
Type | Name | Description |
---|---|---|
int? | retriesCount | The maximum number of retries to be performed. |
TimeSpan? | initialDelay | The optional delay to be applied to the first retry. |
TimeSpan? | delayIncrement | The optional increment to the delay to be applied at each retry. |
Action<RetryErrorPolicy> | policyConfigurationAction | The (optional) additional configuration. |
Returns
Type | Description |
---|---|
IErrorPolicyChainBuilder | The IErrorPolicyChainBuilder so that additional calls can be chained. |
ThenSkip(Action<SkipMessageErrorPolicy>?)
Adds a SkipMessageErrorPolicy that skips the messages that fail to be processed.
Declaration
public IErrorPolicyChainBuilder ThenSkip(Action<SkipMessageErrorPolicy>? policyConfigurationAction = null)
Parameters
Type | Name | Description |
---|---|---|
Action<SkipMessageErrorPolicy> | policyConfigurationAction | The (optional) additional configuration. |
Returns
Type | Description |
---|---|
IErrorPolicyChainBuilder | The IErrorPolicyChainBuilder so that additional calls can be chained. |
ThenStop(Action<StopConsumerErrorPolicy>?)
Adds a StopConsumerErrorPolicy that stops the consumer when an exception is thrown during the message processing.
Declaration
public IErrorPolicyChainBuilder ThenStop(Action<StopConsumerErrorPolicy>? policyConfigurationAction = null)
Parameters
Type | Name | Description |
---|---|---|
Action<StopConsumerErrorPolicy> | policyConfigurationAction | The (optional) additional configuration. |
Returns
Type | Description |
---|---|
IErrorPolicyChainBuilder | The IErrorPolicyChainBuilder so that additional calls can be chained. |