Interface IErrorPolicyChainBuilder
Builds the IErrorPolicy.
Namespace: Silverback.Messaging.Configuration
Assembly: Silverback.Integration.dll
Syntax
public interface IErrorPolicyChainBuilder
Methods
Build()
Builds the IErrorPolicy instance.
Declaration
IErrorPolicy Build()
Returns
| Type | Description |
|---|---|
| IErrorPolicy | The IMessageSerializer. |
ThenMoveTo(string, Action<MoveMessageErrorPolicyBuilder>?)
Adds a MoveMessageErrorPolicy that moves the messages that fail to be processed to the configured endpoint.
Declaration
IErrorPolicyChainBuilder ThenMoveTo(string endpointName, Action<MoveMessageErrorPolicyBuilder>? policyBuilderAction = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | endpointName | The endpoint name. It could be either the topic/queue name or the friendly name of an endpoint that is already configured with a producer. |
| Action<MoveMessageErrorPolicyBuilder> | policyBuilderAction | An Action<T> that takes the MoveMessageErrorPolicyBuilder and configures it. |
Returns
| Type | Description |
|---|---|
| IErrorPolicyChainBuilder | The IErrorPolicyChainBuilder so that additional calls can be chained. |
ThenRetry(Action<RetryErrorPolicyBuilder>?)
Adds a RetryErrorPolicy that retries to process the messages that previously failed to be to processed.
Declaration
IErrorPolicyChainBuilder ThenRetry(Action<RetryErrorPolicyBuilder>? policyBuilderAction = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Action<RetryErrorPolicyBuilder> | policyBuilderAction | An Action<T> that takes the RetryErrorPolicyBuilder and configures it. |
Returns
| Type | Description |
|---|---|
| IErrorPolicyChainBuilder | The IErrorPolicyChainBuilder so that additional calls can be chained. |
ThenRetry(int, Action<RetryErrorPolicyBuilder>?)
Adds a RetryErrorPolicy that retries to process the messages that previously failed to be to processed.
Declaration
IErrorPolicyChainBuilder ThenRetry(int retriesCount, Action<RetryErrorPolicyBuilder>? policyBuilderAction = null)
Parameters
| Type | Name | Description |
|---|---|---|
| int | retriesCount | The maximum number of retries to be performed. |
| Action<RetryErrorPolicyBuilder> | policyBuilderAction | An Action<T> that takes the RetryErrorPolicyBuilder and configures it. |
Returns
| Type | Description |
|---|---|
| IErrorPolicyChainBuilder | The IErrorPolicyChainBuilder so that additional calls can be chained. |
ThenSkip(Action<SkipMessageErrorPolicyBuilder>?)
Adds a SkipMessageErrorPolicy that skips the messages that fail to be processed.
Declaration
IErrorPolicyChainBuilder ThenSkip(Action<SkipMessageErrorPolicyBuilder>? policyBuilderAction = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Action<SkipMessageErrorPolicyBuilder> | policyBuilderAction | An Action<T> that takes the SkipMessageErrorPolicyBuilder and configures it. |
Returns
| Type | Description |
|---|---|
| IErrorPolicyChainBuilder | The IErrorPolicyChainBuilder so that additional calls can be chained. |
ThenStop(Action<StopConsumerErrorPolicyBuilder>?)
Adds a StopConsumerErrorPolicy that stops the consumer when an exception is thrown during the message processing.
Declaration
IErrorPolicyChainBuilder ThenStop(Action<StopConsumerErrorPolicyBuilder>? policyBuilderAction = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Action<StopConsumerErrorPolicyBuilder> | policyBuilderAction | An Action<T> that takes the StopConsumerErrorPolicyBuilder and configures it. |
Returns
| Type | Description |
|---|---|
| IErrorPolicyChainBuilder | The IErrorPolicyChainBuilder so that additional calls can be chained. |