Structured retry policy configuration for stream messages. Controls retry behavior with exponential backoff.

const retryPolicy: RetryPolicy = {
maximumAttempts: 5,
backoffCoefficient: 2,
maximumInterval: '300s',
};
// Results in delays: 2s, 4s, 8s, 16s, 32s, 64s, 128s, 256s, 300s (capped)
interface RetryPolicy {
    backoffCoefficient?: number;
    maximumAttempts?: number;
    maximumInterval?: string | number;
}

Properties

backoffCoefficient?: number

Base coefficient for exponential backoff calculation. Retry delay = min(backoffCoefficient ^ attemptNumber, maximumInterval)

10
2
maximumAttempts?: number

Maximum number of retry attempts before the message fails.

3
5
maximumInterval?: string | number

Maximum interval between retries in seconds or as a duration string. Caps the exponential backoff to prevent excessive delays.

"120s"
"60s" or 60