interface QueueMessage

Queue adapter interface for queue-agnostic operations.

Implement this interface to create drivers for specific message brokers. The Queue class wraps adapters with Task/Stream semantics.

For connection lifecycle management, use QueueConnector which produces adapters. The adapter's close() method releases the connection (e.g., back to a pool) rather than terminating it — termination is the connector's responsibility.

Type Parameters

T = unknown

Properties

id: string

Unique message identifier

Message payload. The message may have no content when q

attempt: number

Number of times this message has been delivered

timestamp: number

Timestamp when the message was first enqueued

optional
metadata: { [key: string]: unknown; headers?: Record<string, string>; }

Optional metadata from the broker

Usage

import { type QueueMessage } from ".";