Registry / storage / groupmq

groupmq

JSON →
library1.1.0jsnpmunverified

GroupMQ v1.1.0 is a per-group FIFO queue built on Redis, designed for Node.js (>=18) and TypeScript. It provides strong ordering guarantees within groups, supporting visibility timeouts and automatic retry for failed jobs. Unlike generic Redis queues like Bull or Kue, GroupMQ enforces strict per-key FIFO semantics, making it ideal for multi-tenant workloads where message ordering per tenant is critical. It is distributed as ESM-only (no CommonJS), ships with TypeScript definitions, and depends on ioredis >=5. Release cadence is irregular; the project is actively maintained with recent commits.

npm install groupmq
INSTALL
IMPORT
SIG · GROUPMQ
G
groupmq
storagejavascriptv1.1.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.

GroupMQ
import { GroupMQ } from 'groupmq'
const GroupMQ = require('groupmq')
GroupMQ is ESM-only; CJS require() will fail. Use dynamic import() if needed in CommonJS projects.
Job
import type { Job } from 'groupmq'
import { Job } from 'groupmq'
Job is a TypeScript type, not a runtime value. Use 'import type' to avoid bundling issues.
QueueOptions
import type { QueueOptions } from 'groupmq'
import { QueueOptions } from 'groupmq'
QueueOptions is an interface, only available as a type.

Creates a GroupMQ queue, adds a job to a group, pops and processes it, then acknowledges it.

import { GroupMQ } from 'groupmq'; import Redis from 'ioredis'; const redis = new Redis({ host: process.env.REDIS_HOST ?? 'localhost' }); const queue = new GroupMQ(redis, { prefix: 'myqueue' }); // Add a job to group 'user-123' await queue.add('user-123', { email: 'user@example.com' }); // Process jobs from group 'user-123' (FIFO) const job = await queue.pop('user-123'); if (job) { console.log('Processing job:', job.id, job.data); // Acknowledge completion to remove from queue await queue.ack(job.id); } // If job fails, it will be retried after visibility timeout // Check pending jobs count const count = await queue.size('user-123'); console.log('Pending jobs:', count); await redis.quit();
Debug
Known issues
breakingGroupMQ is ESM-only: CJS projects must use dynamic import() or switch to ESM.
fix
Use 'import { GroupMQ } from "groupmq"' in an ESM context, or 'const { GroupMQ } = await import("groupmq")' in CJS.
affects: >=1.0.0
breakingRequires Node.js >=18 and ioredis >=5.
fix
Upgrade Node.js to v18+ and ioredis to v5+.
affects: >=1.0.0
gotchaJobs are not automatically retried; they become visible again after the visibility timeout. You must handle retries in your worker logic.
fix
Implement a retry loop that re-pops jobs after timeout, or use the ack() only after successful processing.
affects: >=1.0.0
deprecatedThe 'visibility' option in constructor is ignored since v1.1.0; use per-job visibilityTimeout.
fix
Pass visibilityTimeout in the job options when calling add().
affects: >=1.1.0
Errors
Common errors & fixes
ERR GROUPMQ invalid visibilityTimeout: must be positive integer
visibilityTimeout passed as string or non-positive number.
fix
Ensure visibilityTimeout is a positive integer (e.g., 300).
TypeError: groupmq_1.GroupMQ is not a constructor
Importing with require() in CommonJS; GroupMQ is ESM-only.
fix
Use import syntax or dynamic import: const { GroupMQ } = await import('groupmq');
Error: Cannot find module 'groupmq'
Package not installed or ESM resolution failed.
fix
Run 'npm install groupmq' and ensure package.json has 'type': 'module' or use .mjs extension.
Upgrade
Version history
1.1.0latest on npm
Audit
Dependencies
ioredisrequiredRedis client for connection and queue operations
Agent activity
31 hits · last 30 days
node
28
Amazon
1
Resources
groupmq — npm install groupmq · libregistry