Registry / messaging / moleculer-bee-queue

moleculer-bee-queue

JSON →
library0.1.10jsnpmunverified

A mixin for Moleculer microservices framework that integrates Bee-Queue for task queue functionality. Current stable version is 0.1.10, released as a single version. It allows creating queue worker services and enqueuing jobs with progress reporting and retries. Differentiator: provides a simple mixin pattern to add Bee-Queue support to Moleculer services, but is limited to Bee-Queue (not generic) and uses Moleculer v0.14.x or v0.13.x or v0.12.x with Node >=8.x. The package has no recent updates and is considered stable but not actively maintained.

npm install moleculer-bee-queue
INSTALL
IMPORT
SIG · MOLECULER-BEE-QUEU
M
moleculer-bee-queue
messagingjavascriptv0.1.10
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.

QueueService
const QueueService = require('moleculer-bee-queue');
import QueueService from 'moleculer-bee-queue';
ESM is not supported; the package only provides a CommonJS module.
QueueService()
mixins: [QueueService()]
mixins: [QueueService]
Must call QueueService as a function, not pass the reference directly.
this.createJob
const job = this.createJob('queueName', payload);
this.createJob(payload, 'queueName');
Argument order: first queue name, then payload.

Shows how to create a queue worker service and enqueue a job with retries using moleculer-bee-queue mixin.

const { ServiceBroker } = require('moleculer'); const QueueService = require('moleculer-bee-queue'); const broker = new ServiceBroker(); broker.createService({ name: 'task-worker', mixins: [QueueService()], queues: { 'math.add'(job) { this.logger.info('New job received!', job.data); return this.Promise.resolve({ result: job.data.a + job.data.b }); } } }); broker.createService({ name: 'job-maker', mixins: [QueueService()], methods: { async addNumbers(a, b) { const job = this.createJob('math.add', { a, b }); job.retries(2).save(); return new Promise((resolve) => job.on('succeeded', resolve)); } } }); broker.start().then(() => broker.call('job-maker.addNumbers', { a: 5, b: 3 }));
Debug
Known issues
breakingRequires Moleculer v0.14.x, v0.13.x, or v0.12.x only. Not compatible with Moleculer v1.x or later.
fix
Use an older Moleculer version or avoid using this package with v1+.
affects: >=1.0.0
gotchaQueueService must be called as a function (QueueService()) in mixins; passing the reference without parentheses will not work.
fix
Use mixins: [QueueService()] instead of mixins: [QueueService].
affects: all
deprecatedPackage is unmaintained since 2019; no support for modern Node.js or ESM.
fix
Consider migrating to another queue solution like Bull or using direct Bee-Queue integration.
affects: all
Errors
Common errors & fixes
Error: Cannot find module 'bee-queue'
bee-queue is not listed as a dependency and must be installed separately.
fix
Run 'npm install bee-queue' in your project.
TypeError: QueueService is not a function
QueueService was imported incorrectly or called without parentheses in mixins.
fix
Ensure you use const QueueService = require('moleculer-bee-queue'); and mixins: [QueueService()].
MoleculerError: Service 'task-worker' has no 'queues' schema
QueueService must be called as a function to add the 'queues' property to the schema.
fix
Correct mixins usage: mixins: [QueueService()].
Upgrade
Version history
0.1.10latest on npm
Audit
Dependencies
moleculerrequiredPeer dependency: required for service creation and broker integration
bee-queueoptionalUnderlying queue implementation; not listed as peer but required at runtime
Agent activity
5 hits · last 30 days
node
4
OpenAI (training)
1
Resources
moleculer-bee-queue — npm install moleculer-bee-queue · libregistry