Skip to content

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 ​

PropertyTypeDescriptionDefined in
enabled?booleanWhether to reconnect when the connection or channel is lost. When disabled, a lost connection isn't recovered and the transport stops receiving messages. Default truepackages/bus-rabbitmq/src/rabbitmq-connection-recovery-configuration.ts:13
factor?numberThe multiplier applied to the delay after each failed attempt. Default 2packages/bus-rabbitmq/src/rabbitmq-connection-recovery-configuration.ts:31
initialDelay?numberThe delay in milliseconds before the first reconnect attempt. Default 100packages/bus-rabbitmq/src/rabbitmq-connection-recovery-configuration.ts:19
jitter?numberThe 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.2packages/bus-rabbitmq/src/rabbitmq-connection-recovery-configuration.ts:38
maxDelay?numberThe longest delay in milliseconds between reconnect attempts. Default 30000packages/bus-rabbitmq/src/rabbitmq-connection-recovery-configuration.ts:25
maxRetries?numberThe number of reconnect attempts before giving up. Once recovery gives up, publishing and sending throw RabbitMqConnectionRecoveryFailed and no more messages are received. Default Infinitypackages/bus-rabbitmq/src/rabbitmq-connection-recovery-configuration.ts:45

Released under the MIT License.