API reference / @node-ts/bus-rabbitmq / RabbitMqConnectionRecoveryConfiguration
Interface: RabbitMqConnectionRecoveryConfiguration
Defined in: packages/bus-rabbitmq/src/rabbitmq-connection-recovery-configuration.ts:7
Controls how the RabbitMQ transport recovers when its connection or channel to the broker is lost.
Reconnect attempts back off exponentially: the delay before attempt n is initialDelay * factor ^ (n - 1), capped at maxDelay.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
enabled? | boolean | Whether to reconnect when the connection or channel is lost. When disabled, a lost connection isn't recovered and the transport stops receiving messages. Default true | packages/bus-rabbitmq/src/rabbitmq-connection-recovery-configuration.ts:13 |
factor? | number | The multiplier applied to the delay after each failed attempt. Default 2 | packages/bus-rabbitmq/src/rabbitmq-connection-recovery-configuration.ts:31 |
initialDelay? | number | The delay in milliseconds before the first reconnect attempt. Default 100 | packages/bus-rabbitmq/src/rabbitmq-connection-recovery-configuration.ts:19 |
jitter? | number | The fraction (0-1) of each connection reconnect delay that's randomised, so that many services don't all reconnect at the same moment. Default 0.2 | packages/bus-rabbitmq/src/rabbitmq-connection-recovery-configuration.ts:38 |
maxDelay? | number | The longest delay in milliseconds between reconnect attempts. Default 30000 | packages/bus-rabbitmq/src/rabbitmq-connection-recovery-configuration.ts:25 |
maxRetries? | number | The number of reconnect attempts before giving up. Once recovery gives up, publishing and sending throw RabbitMqConnectionRecoveryFailed and no more messages are received. Default Infinity | packages/bus-rabbitmq/src/rabbitmq-connection-recovery-configuration.ts:45 |