amqplibup
v1.1.1
Published
automatic reconnection/retries for amqplib
Downloads
1
Readme
node-amqplibup
amqplibup is a wrapper for amqplib, providing automatic reconnection/retries when your amqp server is unavailable.
How to use
const amqp = require('amqplibup');
amqp('amqp://my-rabbitmq-server.example.org', conn => {
// conn is a connected amqplib connection object!
// Now, you can do your usual amqplib stuff.
// Please, note, this will run on every successful reconnect!
con.createChannel((err, ch) => {
ch.assertQueue('my-queue');
// ... and so on ...
});
});
- The callback will be called on every successful connect/reconnect.
- There is no error argument on the callback, since no errors will ever be sent to the callback!
Debugging
If environment variable DEBUG
is
truthy,
error log messages will be printed to stderr
on errors.