Class RetryableErrorPolicyBase
Builds an error policy that can be applied multiple times to the same message (e.g. RetryErrorPolicy or MoveMessageErrorPolicy).
Implements
Inherited Members
Namespace: Silverback.Messaging.Inbound.ErrorHandling
Assembly: Silverback.Integration.dll
Syntax
public abstract class RetryableErrorPolicyBase : ErrorPolicyBase, IErrorPolicy
Methods
| Improve this doc View sourceMaxFailedAttempts(int?)
Specifies how many times this rule can be applied to the same message. If multiple policies are chained in an ErrorPolicyChain then the next policy will be triggered after the allotted amount of retries.
Declaration
public ErrorPolicyBase MaxFailedAttempts(int? maxFailedAttempts)
Parameters
Type | Name | Description |
---|---|---|
int? | maxFailedAttempts | The number of retries. |
Returns
Type | Description |
---|---|
ErrorPolicyBase | The ErrorPolicyBase so that additional calls can be chained. |
Remarks
The number of attempts at processing the message are stored locally, in memory and not persisted anywhere. A restart or a Kafka rebalance would cause them to reset.
The messages are uniquely identified according to their IBrokerMessageIdentifier, if the message broker is providing a unique value like the Kafka offset. Otherwise the message id header value is used (MessageId). The mechanism will not work if no unique identifier is provided (e.g. MQTT) and no id header is sent with the message.