node-ts / bus

A typescript based enterprise service bus framework based on enterprise integration patterns
https://bus.node-ts.com/
MIT License
272 stars 25 forks source link

Implement retry strategy #167

Closed adenhertog closed 2 years ago

adenhertog commented 2 years ago

Closes #166

Exposes a RetryStrategy that can be configured at the BusConfiguration level on startup.

This allows the consumer to choose or provide a new strategy that determines the delay between retry attempts on message failures. By default, a DefaultRetryStrategy is provided that delays a message between 5ms to 2.5hrs with a jitter of 10% per retry to avoid any deadlock retries.

All transports except RabbitMQ have implemented this. Rabbit cannot cleanly leverage a retry strategy as messages are immutable, and the way retries are achieved is to redrive failures to a retry queue that has a static TTL.