0.0.5 • Published 10 years ago

amqp-schedule v0.0.5

Weekly downloads
3
License
-
Repository
github
Last release
10 years ago

node-amqp-schedule

Install

npm install amqp-schedule

Use with postwait/node-amqp.

Usage

var scheduler = require('ampq-schedule');
var delayedPublish = scheduler(conn); // conn is an amqp.Connection instance

// later

delayedPublish(exchangeName, routingKey, message, delayMs, messageOptions, callback);

// or

delayedPublish(exchangeName, routingKey, message, date, messageOptions, callback);

Details

delayedPublish creates a temporary queue with ttl and dead letter exchange. The queue expires if it's empty.

You can provide a second paramereter (options) to scheduler. options.prefix is the temp queue name prefix, defaults to schedule.. The temp queue expires after delay + options.threshold, threshold defaults to 10 seconds.

So if you want to publish a message 1 min later in the exchange foo with the routing key bar, the message will be hold in a queue named schedule.foo.bar.60000.

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago