interface QueueAdapter

Queue adapter interface for low-level queue operations.

Methods

send<T>(
queue: string,
data: T,
options?: SendOptions
): Promise<string>

Send a single message to the specified queue.

sendBatch<T>(
queue: string,
data: T[],
options?: SendOptions
): Promise<string[]>

Send a batch of messages to the specified queue. Implementation should optimize this operation if possible (e.g. using pipelines or batch APIs).

receive<T>(
queue: string,
count?: number
): Promise<QueueMessage<T>[]>

Retrieve one or more messages from the specified queue.

ack(
queue: string,
...ids: string[]
): Promise<void>

Acknowledge that one or more messages have been successfully processed. The broker should remove these messages from the queue.

nack(
queue: string,
id: string,
options?: NackOptions
): Promise<void>

Indicate that a message processing failed.

close(): Promise<void>

Release any resources held by this adapter instance. Does not necessarily terminate the underlying connection (which is managed by the Connector).

Usage

import { type QueueAdapter } from ".";