Table of Contents

Class RetryPolicySettings

Namespace
WorkflowForge.Extensions.Resilience.Configurations
Assembly
WorkflowForge.Extensions.Resilience.dll

Configuration settings for retry policies in WorkflowForge operations.

public sealed class RetryPolicySettings : IValidatableObject
Inheritance
RetryPolicySettings
Implements
Inherited Members

Properties

BackoffMultiplier

Gets or sets the backoff multiplier for exponential strategies.

[Range(1.1, 10, ErrorMessage = "BackoffMultiplier must be between 1.1 and 10.0")]
public double BackoffMultiplier { get; set; }

Property Value

double

BaseDelay

Gets or sets the base delay between retries.

[Range(typeof(TimeSpan), "00:00:00", "00:10:00", ErrorMessage = "BaseDelay must be between 0 and 10 minutes")]
public TimeSpan BaseDelay { get; set; }

Property Value

TimeSpan

DefaultExponentialBackoff

Gets a predefined exponential backoff configuration.

public static RetryPolicySettings DefaultExponentialBackoff { get; }

Property Value

RetryPolicySettings

MaxAttempts

Gets or sets the maximum number of retry attempts.

[Range(0, 100, ErrorMessage = "MaxAttempts must be between 0 and 100")]
public int MaxAttempts { get; set; }

Property Value

int

MaxDelay

Gets or sets the maximum delay between retries.

[Range(typeof(TimeSpan), "00:00:00", "01:00:00", ErrorMessage = "MaxDelay must be between 0 and 1 hour")]
public TimeSpan MaxDelay { get; set; }

Property Value

TimeSpan

NoRetry

Gets a predefined no-retry policy configuration.

public static RetryPolicySettings NoRetry { get; }

Property Value

RetryPolicySettings

StrategyType

Gets or sets the retry strategy type.

public RetryStrategyType StrategyType { get; set; }

Property Value

RetryStrategyType

UseJitter

Gets or sets whether to add jitter to retry delays.

public bool UseJitter { get; set; }

Property Value

bool

Methods

Clone()

Creates a deep copy of the current retry policy settings.

public RetryPolicySettings Clone()

Returns

RetryPolicySettings

A new RetryPolicySettings instance with copied values.

Validate(ValidationContext)

Validates the retry policy settings.

public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)

Parameters

validationContext ValidationContext

The validation context.

Returns

IEnumerable<ValidationResult>

A collection of validation results.