Class RetryAttribute
- Namespace
- Excalibur.Dispatch.Options.Resilience
- Assembly
- Excalibur.Dispatch.dll
Specifies retry configuration for a specific message type.
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
public sealed class RetryAttribute : Attribute
- Inheritance
-
RetryAttribute
- Inherited Members
- Extension Methods
Remarks
Apply this attribute to message types to override the global retry configuration with message-specific settings.
Example:
[Retry(MaxRetryAttempts = 5, BaseDelayMs = 500)]
public record ImportDataAction(...) : IDispatchAction;
Properties
BackoffStrategy
Gets or sets the backoff strategy to use.
public BackoffStrategy BackoffStrategy { get; set; }
Property Value
- BackoffStrategy
Default is Exponential.
BaseDelayMs
Gets or sets the base delay between retry attempts in milliseconds.
public int BaseDelayMs { get; set; }
Property Value
- int
Default is 1000 (1 second).
MaxDelayMs
Gets or sets the maximum delay between retry attempts in milliseconds.
public int MaxDelayMs { get; set; }
Property Value
- int
Default is 30000 (30 seconds).
MaxRetryAttempts
Gets or sets the maximum number of retry attempts.
public int MaxRetryAttempts { get; set; }
Property Value
- int
Default is 3.
UseJitter
Gets or sets a value indicating whether to use jitter.
public bool UseJitter { get; set; }