Skip to content

ismriv/amqp-delay.node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Publish messages to RabbitMQ with a delay.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published