Skip to content

basalt / queue-rabbitmq/src / RabbitmqQueuePluginOptions

Interface: RabbitmqQueuePluginOptions ​

Defined in: queue-rabbitmq/src/index.ts:382

Everything queuePlugin accepts, minus driver (this plugin IS the driver choice), plus every RabbitMQ driver option.

Extends ​

Properties ​

connect? ​

> optional connect?: AmqpConnect

Defined in: queue-rabbitmq/src/index.ts:109

Injectable connector — defaults to amqplib. Tests pass a fake.

Inherited from ​

RabbitmqDriverOptions.connect


drainTimeoutMs? ​

> optional drainTimeoutMs?: number

Defined in: queue-rabbitmq/src/index.ts:99

On close(), how long to wait for in-flight job handlers to finish before tearing the channel down anyway. Default 10_000 ms. Unfinished jobs stay unacked, so the broker redelivers them.

Inherited from ​

RabbitmqDriverOptions.drainTimeoutMs


jobs? ​

> optional jobs?: JobDefinition<unknown>[]

Defined in: queue/src/index.ts:61

Jobs known to this process (producer and/or worker).

Inherited from ​

QueuePluginOptions.jobs


maxPriority? ​

> optional maxPriority?: number

Defined in: queue-rabbitmq/src/index.ts:93

Max priority level for priority queues (x-max-priority). Default 10.

Inherited from ​

RabbitmqDriverOptions.maxPriority


onError? ​

> optional onError?: (error, info) => void

Defined in: queue-rabbitmq/src/index.ts:91

Infra errors from the amqplib connection/channel emitters (broker gone, channel torn down). amqplib surfaces these as EventEmitter 'error' events — unhandled, they CRASH the process. Default: console.error with context.

Parameters ​

error ​

unknown

info ​
source ​

"connection" | "channel"

Returns ​

void

Inherited from ​

RabbitmqDriverOptions.onError


onUnsupported? ​

> optional onUnsupported?: UnsupportedPolicy

Defined in: queue/src/index.ts:86

What to do when a job uses an option the driver can't honor (e.g. a delayed job on a driver without delayed delivery). Default 'warn' — set 'throw' in production for a hard guarantee, 'ignore' for the old behavior.

Inherited from ​

QueuePluginOptions.onUnsupported


reconnectDelayMs? ​

> optional reconnectDelayMs?: number

Defined in: queue-rabbitmq/src/index.ts:107

After the connection or channel closes unexpectedly (broker restart, network cut, a channel-level protocol error), how long to wait before reconnecting — doubled on each consecutive failure, capped at 30s. The next add() reconnects on demand; workers are re-subscribed by the reconnect loop. Default 1000 ms.

Inherited from ​

RabbitmqDriverOptions.reconnectDelayMs


removeOnComplete? ​

> optional removeOnComplete?: JobRetention

Defined in: queue/src/index.ts:93

Default retention for completed jobs, for drivers whose backend keeps them (BullMQ/Redis today). true removes on finish, a number keeps that many, { age: '7d', count: 500 } caps both. Default: keep the last 1000. A job can override via defineJob.

Inherited from ​

QueuePluginOptions.removeOnComplete


removeOnFail? ​

> optional removeOnFail?: JobRetention

Defined in: queue/src/index.ts:98

Default retention for failed jobs. Default false (keep all, for inspection and retries) — set e.g. { age: '14d' } so failures don't grow unbounded.

Inherited from ​

QueuePluginOptions.removeOnFail


signingKey? ​

> optional signingKey?: QueueSigningKey | readonly QueueSigningKey[]

Defined in: queue/src/index.ts:104

HMAC key(s) that sign every job envelope; the worker rejects unsigned or tampered jobs. Without it, anyone who can write to the broker can enqueue jobs and choose their tenant/user. See QueueManagerOptions.signingKey.

Inherited from ​

QueuePluginOptions.signingKey


url ​

> url: string

Defined in: queue-rabbitmq/src/index.ts:85

AMQP URL, e.g. amqp://user:pass@host:5672.

Inherited from ​

RabbitmqDriverOptions.url


validateTenantId? ​

> optional validateTenantId?: (id) => boolean

Defined in: queue/src/index.ts:109

Tenant-id grammar accepted from a job's context. Default: tenancy's default grammar. Pass the same function you gave tenancyPlugin.

Parameters ​

id ​

string

Returns ​

boolean

Inherited from ​

QueuePluginOptions.validateTenantId


workers? ​

> optional workers?: object[]

Defined in: queue/src/index.ts:80

Queues to start workers for in this process at boot.

concurrency? ​

> optional concurrency?: number

queue ​

> queue: string

Inherited from ​

QueuePluginOptions.workers

Released under the MIT License.