4.4.0 • Published 6 years ago

jackrabbit v4.4.0

Weekly downloads
2,341
License
MIT
Repository
github
Last release
6 years ago

Jackrabbit

Build Status NPM version

RabbitMQ in Node.js without hating life.

Simple Example

producer.js:

var jackrabbit = require('jackrabbit');
var rabbit = jackrabbit(process.env.RABBIT_URL);

rabbit
  .default()
  .publish('Hello World!', { key: 'hello' })
  .on('drain', rabbit.close);

consumer.js:

var jackrabbit = require('jackrabbit');
var rabbit = jackrabbit(process.env.RABBIT_URL);

rabbit
  .default()
  .queue({ name: 'hello' })
  .consume(onMessage, { noAck: true });

function onMessage(data) {
  console.log('received:', data);
}

Ack/Nack Consumer Example

var jackrabbit = require('jackrabbit');
var rabbit = jackrabbit(process.env.RABBIT_URL);

rabbit
  .default()
  .queue({ name: 'important_job' })
  .consume(function(data, ack, nack, msg) {

    // process data...
    // and ACK on success
    ack();

    // or alternatively NACK on failure
    // NOTE: this will requeue automatically
    nack();

    // or, if you want to nack without requeue:
    nack({
      requeue: false
    });
  })

Jackrabbit is designed for simplicity and an easy API. If you're an AMQP expert and want more power and flexibility, check out Rabbot.

More Examples

For now, the best usage help is can be found in examples, which map 1-to-1 with the official RabbitMQ tutorials.

Installation

npm install --save jackrabbit

Tests

The tests are set up with Docker + Docker-Compose, so you don't need to install rabbitmq (or even node) to run them:

$ docker-compose run jackrabbit npm test

If using Docker-Machine on OSX:

$ docker-machine start
$ eval "$(docker-machine env default)"
$ docker-compose run jackrabbit npm test

Release

Releases should be tagged according to Semantic Versioning

Process:

  • Add release notes to releases.md
  • Commit add push the release notes git commit releases.md && git push origin master
  • Release it ./node_modules/release-it/bin/release-it.js
4.4.0

6 years ago

4.3.0

8 years ago

4.2.0

8 years ago

4.1.0

8 years ago

4.0.3

8 years ago

4.0.2

9 years ago

4.0.1

9 years ago

4.0.0

9 years ago

3.0.9

9 years ago

3.0.8

9 years ago

3.0.7

9 years ago

3.0.6

9 years ago

3.0.5

9 years ago

3.0.4

9 years ago

3.0.3

9 years ago

3.0.2

9 years ago

3.0.1

9 years ago

3.0.0

9 years ago

2.4.0

9 years ago

2.3.0

10 years ago

2.2.0

10 years ago

2.1.0

10 years ago

2.0.0

10 years ago

1.0.0

10 years ago