Client SDKsNode.jsReference
Queues
Durable queues, polling, and streaming — KubeMQ Node.js SDK reference.
Send with sendQueueMessage, receive with receiveQueueMessages, and use streaming helpers for advanced throughput (see examples for stream send/receive, ack ranges, poll mode).
Simple Queues
sendQueueMessage
await client.sendQueueMessage(message: QueueMessage): Promise<QueueSendResult>receiveQueueMessages
const messages = await client.receiveQueueMessages(request: QueuePollRequest): Promise<ReceivedQueueMessage[]>QueuePollRequest:
| Field | Type | Required | Description |
|---|---|---|---|
channel | string | Yes | Queue channel |
maxMessages | number | No | Batch size |
waitTimeoutSeconds | number | Yes | Long poll wait |
autoAck | boolean | No | Auto-acknowledge on receipt |
Each received message exposes ack(), nack(), and reQueue(channel) helpers.
Queue Streaming
Streaming queue APIs (upstream/downstream, batch ack/nack) follow the patterns demonstrated in the Queues examples. Refer to the example index for stream send, stream receive, auto ack, ack range, nack/requeue, and poll mode.
Quick Usage
await client.sendQueueMessage(
createQueueMessage({ channel: "jobs", body: Buffer.from("task") }),
);See Also
Was this page helpful?