Interface IErrorPolicyBuilder
Builds the IErrorPolicy.
Namespace: Silverback.Messaging.Configuration
Assembly: Silverback.Integration.dll
Syntax
public interface IErrorPolicyBuilder
Methods
Build()
Builds the IErrorPolicy instance.
Declaration
IErrorPolicy Build()
Returns
| Type | Description |
|---|---|
| IErrorPolicy | The IMessageSerializer. |
MoveTo(string, Action<MoveMessageErrorPolicyBuilder>?)
Adds a MoveMessageErrorPolicy that moves the messages that fail to be processed to the configured endpoint.
Declaration
IErrorPolicyChainBuilder MoveTo(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 IErrorPolicyBuilder so that additional calls can be chained. |
Retry(Action<RetryErrorPolicyBuilder>?)
Adds a RetryErrorPolicy that retries to process the messages that previously failed to be to processed.
Declaration
IErrorPolicyChainBuilder Retry(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 IErrorPolicyBuilder so that additional calls can be chained. |
Retry(int, Action<RetryErrorPolicyBuilder>?)
Adds a RetryErrorPolicy that retries to process the messages that previously failed to be to processed.
Declaration
IErrorPolicyChainBuilder Retry(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 IErrorPolicyBuilder so that additional calls can be chained. |
Skip(Action<SkipMessageErrorPolicyBuilder>?)
Adds a SkipMessageErrorPolicy that skips the messages that fail to be processed.
Declaration
IErrorPolicyChainBuilder Skip(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 IErrorPolicyBuilder so that additional calls can be chained. |
Stop(Action<StopConsumerErrorPolicyBuilder>?)
Adds a StopConsumerErrorPolicy that stops the consumer when an exception is thrown during the message processing.
Declaration
IErrorPolicyChainBuilder Stop(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 IErrorPolicyBuilder so that additional calls can be chained. |