Path: redb-route/redb.Route/Definitions/RedeliveryPolicy.cs
Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route
Page: https://redbase.app/src/dev-2026-12-06/redb-route/redb.Route/Definitions/RedeliveryPolicy.cs
----
namespace redb.Route.Definitions;
///
/// Pre-configured redelivery policy that can be shared across multiple OnException handlers.
/// Store in properties for reuse.
///
public sealed class RedeliveryPolicy
{
/// Maximum number of redelivery (retry) attempts. Default: 0 (no retries).
public int MaximumRedeliveries { get; init; }
/// Delay between retry attempts. Default: 1 second.
public TimeSpan RedeliveryDelay { get; init; } = TimeSpan.FromSeconds(1);
/// Backoff multiplier applied to the delay after each retry. Default: 1.0 (fixed delay).
public double BackOffMultiplier { get; init; } = 1.0;
/// Whether to use exponential backoff. Default: false.
public bool UseExponentialBackOff { get; init; }
/// Collision avoidance factor (jitter). 0.0 = no jitter, 0.15 = ±15%. Default: 0.
public double CollisionAvoidanceFactor { get; init; }
/// Delay pattern string overriding standard delay. Format: "attempt:delayMs;...".
public string? DelayPattern { get; init; }
/// Whether to include stack trace in retry log messages. Default: true.
public bool LogStackTrace { get; init; } = true;
/// Whether to log when retries are exhausted. Default: true.
public bool LogExhausted { get; init; } = true;
/// Allow redelivery while the route is stopping. Default: false.
public bool AllowRedeliveryWhileStopping { get; init; }
}