Registry / messaging / queen-mq

queen-mq

JSON →
library0.15.0jsnpmunverified

Queen MQ is a PostgreSQL-backed message queue client for Node.js (v0.15.0, stable), offering FIFO partitions, consumer groups, exactly-once semantics, and streaming with windowed aggregation. It provides a fluent promise-based API with support for transactions, dead letter queues, message tracing, and client-side buffering. Designed for high performance (200K+ msgs/sec), it requires Node.js 22+. Unlike Bull or Bee-Queue, Queen MQ uses PostgreSQL as its backend and offers Kafka-like consumer groups with independent progress tracking.

npm install queen-mq
INSTALL
IMPORT
SIG · QUEEN-MQ
Q
queen-mq
messagingjavascriptv0.15.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Queen
import { Queen } from 'queen-mq'
const Queen = require('queen-mq')
Package is ESM-only since v0.15.0; CommonJS require will fail.
default
import { Queen } from 'queen-mq'
import Queen from 'queen-mq'
No default export; use named import { Queen }.
types
import type { QueueConfig } from 'queen-mq'
import { QueueConfig } from 'queen-mq'
TypeScript types are exported as types, not values.

Creates a queue, pushes a message, and sets up a consumer with auto-ack.

import { Queen } from 'queen-mq' const queen = new Queen('http://localhost:6632') await queen.queue('tasks').create() await queen.queue('tasks').push([ { data: { task: 'send-email', to: 'alice@example.com' } } ]) const consumer = await queen.queue('tasks').consume(async (message) => { console.log('Processing:', message.data) }) await consumer.close()
Debug
Known issues
breakingESM-only since v0.15.0 — CommonJS require() will throw ERR_REQUIRE_ESM.
fix
Use import { Queen } from 'queen-mq' or update to ESM.
affects: >=0.15.0
deprecatedUsing no arguments when constructing Queen defaults to 'http://localhost:6632' — this will change in a future release.
fix
Always pass a server URL explicitly.
affects: >=0.10.0
gotchaconsume() returns a Consumer object that must be closed — forgetting to close leads to hanging connections.
fix
Call consumer.close() in a finally block or use a resource manager.
affects: >=0.1.0
gotchaPartition keys must be strings — passing numbers or objects will throw.
fix
Convert partition keys with String() before calling .partition().
affects: >=0.1.0
breakingPrior to v0.14.0, the push() method accepted a single message object — now it requires an array.
fix
Wrap the message in an array: push([message]).
affects: <0.14.0
Errors
Common errors & fixes
ERR_REQUIRE_ESM
Using require() on an ESM-only package.
fix
Switch to import syntax or use .mjs extension.
TypeError: queen.queue(...).consume is not a function
Calling consume() after a non-fluent method that returns undefined.
fix
Chain methods correctly: queen.queue('name').consume(...).
Error: Partition key must be a string
Passing a non-string partition key.
fix
Use String(partitionKey) when calling .partition().
Upgrade
Version history
0.15.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
18 hits · last 30 days
node
16
Amazon
1
OpenAI (training)
1
Resources
queen-mq — npm install queen-mq · libregistry