JS client similar to hedwig-py
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples
lib Add error stack and log JSON (#1) May 14, 2018
.gitignore
LICENSE
README.md
api.js
package-lock.json
package.json

README.md

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.