npm.io
1.0.1 • Published 8 years ago

@emartech/rabbitmq-queue-manager

Licence
ISC
Version
1.0.1
Deps
2
Size
6 kB
Vulns
0
Weekly
0
DeprecatedThis package is deprecated

@emartech/rabbitmq-queue-manager

queueWorker(workerId, options)

Starts a new worker with the given worker id.

To set required keys in the options, set requiredKeys in the worker's configuration as an array.

Example

const queueManager = require('@emartech/rabbitmq-queue-manager').create();

class MyWorker {

  async run() {
    queueManager.queueWorker('NextWorker', { newVar: 'foo' });
  }

}

Configuration

@emartech/rabbitmq-queue-manager uses node-config `package for configuration.

Required configuration example
{
  "RabbitMQ": "rabbitmq://connection",
  "Workers": {
    "NextWorker": {
      "requiredKeys": ["newVar"]
    }
  }
}