A Fork of squaremo/amqp.node using latest Bluebird promise
npm install "git+https://github.com/uschen/amqp.node#master"
AMQP 0-9-1 library and client for Node.JS
npm install amqplib
A library for making AMQP 0-9-1 clients for Node.JS, and an AMQP 0-9-1 client for Node.JS v0.8, v0.9, v0.10, v0.11, v0.12, and io.js v1.0 and v1.1.
This library does not implement AMQP 1.0 or AMQP 0-10.
Project status:
- Expected to work
- Complete high-level and low-level APIs (i.e., all bits of the protocol)
- A fair few tests
- Measured test coverage
- Ports of the RabbitMQ tutorials as examples
- Used in production
Still working on:
- Getting to 100% (or very close to 100%) test coverage
- Settling on completely stable APIs
Callback API example
var q = 'tasks'; { console; process;} // Publisher { conn; { if err != null ; ch; ch; }} // Consumer { var ok = conn; { if err != null ; ch; ch; }} ;
Promise API example
var q = 'tasks'; var open = ; // Publisheropen; // Consumeropen;
Running tests
npm test
Best run with a locally-installed RabbitMQ, but you can point it at
another using the environment variable URL
; e.g.,
URL=amqp://dev.rabbitmq.com npm test
NB You may experience test failures due to timeouts if using the dev.rabbitmq.com instance.
You can run it under different versions of Node.JS using nave:
nave use 0.8 npm test
or run the tests on all supported versions of Node.JS in one go:
make test-all-nodejs
(which also needs nave
installed, of course).
Lastly, setting the environment variable LOG_ERRORS
will cause the
tests to output error messages encountered, to the console; this is
really only useful for checking the kind and formatting of the errors.
LOG_ERRORS=true npm test
Test coverage
make coverage
open file://`pwd`/coverage/lcov-report/index.html