Registry / messaging / devbox-queue

devbox-queue

JSON →
library1.0.9jsnpmunverified

A lightweight RabbitMQ wrapper for Node.js that provides simplified publisher and listener interfaces. Version 1.0.9, released with infrequent updates. Supports configurable queues, logging, and message persistence. Differentiates from amqplib by abstracting connection and channel management into a simple callback-based API. Primarily designed for internal use in the Devbox ecosystem.

npm install devbox-queue
INSTALL
IMPORT
SIG · DEVBOX-QUEUE
D
devbox-queue
messagingjavascriptv1.0.9
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.

default (factory function)
✓ const amqp = require('devbox-queue')(config);
✗ const { publisher, listener } = require('devbox-queue');
The package exports a factory function that must be called with a config object. Destructuring the require directly will not work.

Shows full setup: config object, listener with message handling, and publisher with callback.

const config = { queueName: 'my-queue', uri: process.env.RABBITMQ_URI ?? 'amqp://localhost', log: console.log, logCollectionName: 'queueLogs', caller: 'my-service', persistent: false }; const amqp = require('devbox-queue')(config); // Listener amqp.listener(function (message, removeFromQueue) { console.log('Received:', message); removeFromQueue(); }); // Publisher const msg = { meta: {}, body: { text: 'Hello' } }; amqp.publisher(msg, function (err, data) { if (err) console.error('Publish error:', err); else console.log('Published:', data); });
Debug
Known issues
gotchaThe config object requires 'uri' but the README shows 'path-queue' which is not a valid URI format.
fix
Provide a valid AMQP URI, e.g., 'amqp://user:pass@host:5672/vhost'.
affects: >=1.0.0
gotchaThe listener callback must call removeFromQueue() to acknowledge the message; otherwise messages may be re-delivered.
fix
Always call removeFromQueue() after processing to avoid message accumulation.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: amqp is not a function
Importing the package incorrectly (e.g., using destructuring).
fix
Use: const amqp = require('devbox-queue')(config);
Error: connect ECONNREFUSED ::1:5672
RabbitMQ server not running or wrong URI.
fix
Ensure RabbitMQ is running and URI config is correct.
Upgrade
Version history
1.0.9latest on npm
Audit
Dependencies
amqplibrequiredRabbitMQ client library for AMQP protocol
Agent activity
12 hits · last 30 days
node
10
Amazon
1
OpenAI (training)
1
Resources