Retry failed jobs, with exponential backoff (or custom) strategy.
npm install amqp-retry
Old code, without retry logic
queue.subscribe(options, handler);
New, smart code
var retry = require('amqp-retry');
queue.subscribe(options, retry(initialDelay, limit, handler));
If handler throws an error, the message will be requeued with some delay (uses amqp-schedule
internally).
You can explicitly requeue the job with job.retry()
. See examples for details.