amqplibup

1.1.1 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i amqplibup

Weekly Downloads

5

Version

1.1.1

License

ISC

Last publish

Collaborators

  • alfredgodoy