Interface IErrorPolicyBuilder
- Namespace
- Silverback.Messaging.Configuration
- Assembly
- Silverback.Integration.dll
Builds the IErrorPolicy.
public interface IErrorPolicyBuilder
Methods
Build()
Builds the IErrorPolicy instance.
IErrorPolicy Build()
Returns
MoveTo(string, Action<MoveMessageErrorPolicyBuilder>?)
Adds a MoveMessageErrorPolicy that moves the messages that fail to be processed to the configured endpoint.
IErrorPolicyChainBuilder MoveTo(string endpointName, Action<MoveMessageErrorPolicyBuilder>? policyBuilderAction = null)
Parameters
endpointNamestringThe endpoint name. It could be either the topic/queue name or the friendly name of an endpoint that is already configured with a producer.
policyBuilderActionAction<MoveMessageErrorPolicyBuilder>An Action<T> that takes the MoveMessageErrorPolicyBuilder and configures it.
Returns
- 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.
IErrorPolicyChainBuilder Retry(Action<RetryErrorPolicyBuilder>? policyBuilderAction = null)
Parameters
policyBuilderActionAction<RetryErrorPolicyBuilder>An Action<T> that takes the RetryErrorPolicyBuilder and configures it.
Returns
- 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.
IErrorPolicyChainBuilder Retry(int retriesCount, Action<RetryErrorPolicyBuilder>? policyBuilderAction = null)
Parameters
retriesCountintThe maximum number of retries to be performed.
policyBuilderActionAction<RetryErrorPolicyBuilder>An Action<T> that takes the RetryErrorPolicyBuilder and configures it.
Returns
- 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.
IErrorPolicyChainBuilder Skip(Action<SkipMessageErrorPolicyBuilder>? policyBuilderAction = null)
Parameters
policyBuilderActionAction<SkipMessageErrorPolicyBuilder>An Action<T> that takes the SkipMessageErrorPolicyBuilder and configures it.
Returns
- 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.
IErrorPolicyChainBuilder Stop(Action<StopConsumerErrorPolicyBuilder>? policyBuilderAction = null)
Parameters
policyBuilderActionAction<StopConsumerErrorPolicyBuilder>An Action<T> that takes the StopConsumerErrorPolicyBuilder and configures it.
Returns
- IErrorPolicyChainBuilder
The IErrorPolicyBuilder so that additional calls can be chained.