RabbitMQ queue adapter implementation.
Uses AMQP 0-9-1 via amqplib. Implements the claim-based reserve pattern to prevent double-dispatch. Uses polling via basicGet (NOT push consume) and per-message TTL + DLX for delayed re-delivery.
Key topology per job name <n>:
he.queue.<n>.ready- Ready queue (polling via basicGet)he.queue.<n>.delay- Delay queue (TTL + DLX → ready)he.queue.<n>.dead- Dead queue (final resting place)
All queues are reached via the default exchange (routing key = queue name).
RabbitMqQueue(runtime: IRuntimeServices,options?: RabbitMqQueueOptions)
Creates a new RabbitMQ queue adapter.
options: RabbitMqQueueOptions
RabbitMQ connection and configuration options
isHealthy: () => Promise<boolean>
M70c: present only when the connection exposes on?; its absence is
unknown reachability, not false.
ack(name: string,id: string,_claimToken?: string): Promise<void>
Acknowledges a job as successfully processed.
advanceRecurring(id: string,nextRunAtMs: number): Promise<void>
Advances a recurring job's next run time.
connect(): Promise<void>
Connects the adapter to its backend.
deadLetter(name: string,id: string,nowMs: number,_claimToken?: string): Promise<void>
Moves a job to the dead letter queue.
disconnect(): Promise<void>
Disconnects the adapter.
enqueue<T>(job: StoredJob<T>): Promise<void>
Enqueues a job.
fetchRecurringDue(nowMs: number): Promise<readonly StoredRecurring[]>
Fetches recurring jobs that are due.
isReady(): boolean
Checks if the adapter is ready/connected.
requeue<T>(name: string,id: string,availableAtMs: number,attempts: number,_claimToken?: string): Promise<void>
Requeues a job with a new available timestamp.
reserve<T>(name: string,limit: number,_nowMs: number): Promise<readonly StoredJob<T>[]>
Reserves up to limit jobs that are due (availableAtMs <= nowMs).
CLAIMS jobs: moves them from ready set to processing set. A reserved job is not returned by subsequent reserve calls.
storeRecurring(rec: StoredRecurring): Promise<void>
Stores a recurring job.