hedwig-js
v0.0.6
Published
Amqp wrapper for simplified messaging between services
Downloads
390
Readme
Hedwig
JS client similar to hedwig-py
Hedwig makes connecting to any AMQP 0.9.1 server simple.
It wraps amqplib
and exposes few simple functions over it.
It handles reconnection, exponential backoff, publish queueing etc internally.
Installation
npm install --save hedwig-js
API
Like it's python cousin, Hedwig exposes 1 method to publish
and one to consume
.
const hedwig = new Hedwig(configuration, err_callback, close_callback)
// Ask hedwig to start consuming from RabbitMQ
hedwig.consume();
let buffer_payload = new Buffer("hello world");
// Publish a message to
hedwig.publish("my.routing.key.here", buffer_payload);
Thats it!
Examples
Do check the examples directory for examples on how to use hedwig.