---
url: >-
  https://node-ts.github.io/bus/api/bus-rabbitmq/interfaces/RabbitMqConnectionRecoveryConfiguration.md
---
[API reference](../../index.md) / [@node-ts/bus-rabbitmq](../index.md) / RabbitMqConnectionRecoveryConfiguration

# Interface: RabbitMqConnectionRecoveryConfiguration

Defined in: [packages/bus-rabbitmq/src/rabbitmq-connection-recovery-configuration.ts:7](https://github.com/node-ts/bus/blob/2e6cf65c27833b707ae31ee623cfb6343770f434/packages/bus-rabbitmq/src/rabbitmq-connection-recovery-configuration.ts#L7)

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 |
| ------ | ------ | ------ | ------ |
| <a id="property-enabled"></a> `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](https://github.com/node-ts/bus/blob/2e6cf65c27833b707ae31ee623cfb6343770f434/packages/bus-rabbitmq/src/rabbitmq-connection-recovery-configuration.ts#L13) |
| <a id="property-factor"></a> `factor?` | `number` | The multiplier applied to the delay after each failed attempt. **Default** `2` | [packages/bus-rabbitmq/src/rabbitmq-connection-recovery-configuration.ts:31](https://github.com/node-ts/bus/blob/2e6cf65c27833b707ae31ee623cfb6343770f434/packages/bus-rabbitmq/src/rabbitmq-connection-recovery-configuration.ts#L31) |
| <a id="property-initialdelay"></a> `initialDelay?` | `number` | The delay in milliseconds before the first reconnect attempt. **Default** `100` | [packages/bus-rabbitmq/src/rabbitmq-connection-recovery-configuration.ts:19](https://github.com/node-ts/bus/blob/2e6cf65c27833b707ae31ee623cfb6343770f434/packages/bus-rabbitmq/src/rabbitmq-connection-recovery-configuration.ts#L19) |
| <a id="property-jitter"></a> `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](https://github.com/node-ts/bus/blob/2e6cf65c27833b707ae31ee623cfb6343770f434/packages/bus-rabbitmq/src/rabbitmq-connection-recovery-configuration.ts#L38) |
| <a id="property-maxdelay"></a> `maxDelay?` | `number` | The longest delay in milliseconds between reconnect attempts. **Default** `30000` | [packages/bus-rabbitmq/src/rabbitmq-connection-recovery-configuration.ts:25](https://github.com/node-ts/bus/blob/2e6cf65c27833b707ae31ee623cfb6343770f434/packages/bus-rabbitmq/src/rabbitmq-connection-recovery-configuration.ts#L25) |
| <a id="property-maxretries"></a> `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](https://github.com/node-ts/bus/blob/2e6cf65c27833b707ae31ee623cfb6343770f434/packages/bus-rabbitmq/src/rabbitmq-connection-recovery-configuration.ts#L45) |
