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.
npm install --save hedwig-js
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!
Do check the examples directory for examples on how to use hedwig.