amqp-delay.node

Publish messages to RabbitMQ with a delay.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
amqp-delay.node
410.2.07 years ago7 years agoMinified + gzip package size for amqp-delay.node in KB

Readme

amqp-delay.node
!NPM versionnpm-imagenpm-url
Publish messages to RabbitMQ immediately, but queue consumers will only receive these messages after a certain delay. The AMQP protocol does not support this directly, but RabbitMQ's AMQP Dead-Letter Exchanges extension we can easily achieve this functionality.
Inspired by node-amqp-schedule, but built for amqplib.

Install

$ npm install amqp-delay.node --save

Usage

var amqp = require('amqplib');

amqp.connect().then(function(conn) {
  return conn.createChannel().then(function (channel) {
    require('amqp-delay.node')(channel);
    return channel.delay(3000).publish('foo', 'bar', new Buffer('hello world'));
  });
}).then(null, console.warn);

License

MIT © Ismael Rivera