RetryOptions
Αυτό το περιεχόμενο δεν είναι ακόμη διαθέσιμο στη γλώσσα σου.
Defined in: packages/pipeline-resilience/src/interfaces/resilience-options.interface.ts:65
Retry configuration of the behavior — re-runs all downstream pipeline work on a handled failure.
Extends
Section titled “Extends”Properties
Section titled “Properties”backoff?
Section titled “backoff?”
optionalbackoff?:RetryBackoff
Defined in: packages/pipeline-resilience/src/interfaces/resilience-options.interface.ts:61
Delay strategy between attempts. Defaults to no delay.
Inherited from
Section titled “Inherited from”maxAttempts
Section titled “maxAttempts”maxAttempts:
number
Defined in: packages/pipeline-resilience/src/interfaces/resilience-options.interface.ts:58
Maximum number of retry attempts after the initial call (e.g. 3 allows
the original execution plus up to three retries), matching Cockatiel’s
retry(..., { maxAttempts }) semantics.
Inherited from
Section titled “Inherited from”RetryPolicyOptions.maxAttempts
replaySafe?
Section titled “replaySafe?”
optionalreplaySafe?:boolean
Defined in: packages/pipeline-resilience/src/interfaces/resilience-options.interface.ts:90
Explicit acknowledgement that replaying the handler/downstream behaviors is
safe. Required for command and event retries because those request kinds
commonly perform side effects.
Queries do not require this acknowledgement.
Set this only when the operation is genuinely replay-safe — for example the
side effect is protected by a downstream idempotency key, transaction, or
otherwise repeatable contract. @cqrs-ddd/pipeline-idempotency does not make
arbitrary external effects exactly-once by itself.
Example
Section titled “Example”Replay-safe command retry
@pipeline.wrap({ kind: 'command' }, [ResilienceBehavior, { retry: { maxAttempts: 2, replaySafe: true, backoff: { type: 'exponential', maxDelay: 1_000 }, }, handle: (error) => error instanceof TransientGatewayError,}])