npm.io
1.0.0 • Published 11 years ago

jrs

Licence
MIT
Version
1.0.0
Deps
2
Vulns
0
Weekly
0

JRS (Jack Rabbit Micro Serivce)

This module wraps the Jack Rabbit module to make it easy to integrate RabbitMQ into micro-services via event emitter pattern.

Usage


var jrs = require('jrs');

var svc = jrs({ server: 'amqp://localhost', queue: 'foo.bar'});

svc.on('job', function(job, ack) {
  // process job and acknowledge  
  console.log(job);
  ack();
});

svc.on('error', function(err) {
  // handle error
});

or with highland

var jrs = require('jrs');
var _ = require('highland');

var handleJob = /* ... */;
var handleError = /* ... */;

var svc = jrs({ server: 'amqp://localhost', queue: 'foo.bar'});

_('job', svc, ['job', 'ack']).each(handleJob);
_('error', svc).each(handleError);

Install

npm install jrs --save

LICENSE

MIT

Contributing

(see CONTRIBUTING.md)

Thanks

  • Creator of JackRabbit
  • Creator of Node
  • Creator of OPEN Open Source

Contributors

Keywords