Class ErrorPolicyChainBuilder
Builds the IErrorPolicy.
Inheritance
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. |
System.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 |
---|---|---|
System.Action<RetryErrorPolicy> | policyConfigurationAction | The (optional) additional configuration. |
Returns
Type | Description |
---|---|
IErrorPolicyChainBuilder | The IErrorPolicyChainBuilder so that additional calls can be chained. |
ThenRetry(Int32, 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 |
---|---|---|
System.Int32 | retriesCount | The maximum number of retries to be performed. |
System.Action<RetryErrorPolicy> | policyConfigurationAction | The (optional) additional configuration. |
Returns
Type | Description |
---|---|
IErrorPolicyChainBuilder | The IErrorPolicyChainBuilder so that additional calls can be chained. |
ThenRetry(Int32, 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 |
---|---|---|
System.Int32 | retriesCount | The maximum number of retries to be performed. |
System.TimeSpan | initialDelay | The optional delay to be applied to the first retry. |
System.Action<RetryErrorPolicy> | policyConfigurationAction | The (optional) additional configuration. |
Returns
Type | Description |
---|---|
IErrorPolicyChainBuilder | The IErrorPolicyChainBuilder so that additional calls can be chained. |
ThenRetry(Nullable<Int32>, Nullable<TimeSpan>, Nullable<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 |
---|---|---|
System.Nullable<System.Int32> | retriesCount | The maximum number of retries to be performed. |
System.Nullable<System.TimeSpan> | initialDelay | The optional delay to be applied to the first retry. |
System.Nullable<System.TimeSpan> | delayIncrement | The optional increment to the delay to be applied at each retry. |
System.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 |
---|---|---|
System.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 |
---|---|---|
System.Action<StopConsumerErrorPolicy> | policyConfigurationAction | The (optional) additional configuration. |
Returns
Type | Description |
---|---|
IErrorPolicyChainBuilder | The IErrorPolicyChainBuilder so that additional calls can be chained. |