amqp-delay.node

0.2.0 • Public • Published

amqp-delay.node

NPM version

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

Package Sidebar

Install

npm i amqp-delay.node

Weekly Downloads

293

Version

0.2.0

License

none

Last publish

Collaborators

  • ismriv