API reference / @node-ts/bus-core / DefaultRetryStrategy
Class: DefaultRetryStrategy
Defined in: packages/bus-core/src/retry-strategy/default-retry-strategy.ts:11
A default message retry strategy that exponentially increases the delay between retries from 5ms to 2.5 hrs for the first 10 attempts. Each retry delay includes a jitter of up to 10% to avoid deadlock-related errors from continually blocking.
Implements
Constructors
Constructor
ts
new DefaultRetryStrategy(): DefaultRetryStrategy;Returns
DefaultRetryStrategy
Methods
calculateRetryDelay()
ts
calculateRetryDelay(currentAttempt): number;Defined in: packages/bus-core/src/retry-strategy/default-retry-strategy.ts:12
Calculate the delay between retrying a failed message
Parameters
| Parameter | Type | Description |
|---|---|---|
currentAttempt | number | How many attempts at handling the message have failed |
Returns
number
The number of milliseconds to delay retrying a failed message attempt