3

I'm looking for a solution to set up delayed jobs in node.js web app.

My first idea was to use RabbitMQ - Dead Letter Exchanges and Per-Message Time-To-Live. By marking messages as persistent we can get a guarantee that a message won't be lost. A TTL can be specified on a per-message basis, so for each task an delay in milliseconds can be specified - this is also important, we can have any value as a message expiration property. But there is a caution on RabbitMQ site:

expired messages can queue up behind non-expired ones until the latter are consumed or expired.

For example if there are messages in queue with following expirations fields: 30s 20s 10s, handlers for messages will be fired in the same order, not as expected 10s 20s 30s.

So I need another solution which is just works out of box.

enzo
  • 287
  • 5
  • 12

2 Answers2

2

I think agenda could be a solution.

enzo
  • 287
  • 5
  • 12
1

I would recommend Kue. It is backed by redis, provides API and admin webapp.

A key feature of Kue is its clean user-interface for viewing and managing queued, active, failed, and completed jobs

sstauross
  • 2,602
  • 2
  • 30
  • 50