Registry / devops / bull-qm

bull-qm

JSON →
library2.0.1jsnpmunverified

Queue Manager for Bull that reduces Redis connections by sharing a single client and subscriber across all queues. Version 2.0.1 is current. It wraps Bull queues to limit connections; each Bull queue normally creates 3 Redis connections, leading to thousands. This manager shares connections, solving that scaling problem. Alternative to managing Bull instances directly.

npm install bull-qm
INSTALL
IMPORT
SIG · BULL-QM
B
bull-qm
devopsjavascriptv2.0.1
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.

QueueManager
import { QueueManager } from 'bull-qm'
import QueueManager from 'bull-qm'
Named export, not default. ESM or CJS both use named export.
QueueManager
const { QueueManager } = require('bull-qm')
const QueueManager = require('bull-qm')
CommonJS destructure required; direct require returns the object with QueueManager property.
QueueManager instance
const manager = new QueueManager({ redis: { host: 'localhost', port: 6379 } })
const manager = new QueueManager()
Must pass BullOpts object with at least redis connection details; otherwise connection fails.

Creates a QueueManager, enqueues a job, processes it, and shuts down cleanly.

import { QueueManager } from 'bull-qm'; // Initialize the manager with Bull options const manager = new QueueManager({ redis: { host: process.env.REDIS_HOST ?? '127.0.0.1', port: Number(process.env.REDIS_PORT) ?? 6379 } }); // Add a job to a queue (creates the queue if not existing) await manager.enqueue('myQueue', { foo: 'bar' }, { attempts: 3 }); // Get the queue instance to attach processors const queue = manager.getQueue('myQueue'); queue.process(async (job) => { console.log('Processing job', job.id); }); // Graceful shutdown await manager.shutdown();
Debug
Known issues
gotchaAll queues share the same Redis clients; custom client configuration per queue is not supported. This can cause issues if different queues require different Redis databases or connection settings.
fix
Use separate QueueManager instances for different Redis configurations.
affects: >=1.0.0
gotchaShutting down the manager closes the shared Redis clients, affecting all queues. Ensure no pending operations after shutdown.
fix
Call manager.shutdown() only after all queue processing is complete.
affects: >=1.0.0
gotchaQueue creation via enqueue uses default options; if queue-specific options (e.g., prefix) are needed, call getQueue or createQueue first with those options.
fix
Use manager.createQueue(name, options) to set queue-specific options before enqueueing.
affects: >=1.0.0
Errors
Common errors & fixes
Error: connect ECONNREFUSED 127.0.0.1:6379
Redis server not running or incorrect host/port in BullOpts.redis.
fix
Ensure Redis is running and pass correct connection details to QueueManager constructor.
TypeError: Cannot read properties of undefined (reading 'client')
QueueManager created without valid BullOpts object.
fix
Initialize with an object containing redis connection info: new QueueManager({ redis: { host: '...' } }).
Upgrade
Version history
2.0.1latest on npm
Audit
Dependencies
bulloptionalpeer dependency; wraps Bull queues to manage them
ioredisrequiredused internally for Redis clients
Agent activity
11 hits · last 30 days
node
10
Amazon
1
Resources
bull-qm — npm install bull-qm · libregistry