mardi 8 septembre 2015

AWS SQS: Delay making available a message that failed to process

Here's my scenario:

  • I have an SQS queue which processes a number of tasks. Those tasks can, and often times do, fail. Their failure is common and somewhat expected.
  • When a task fails, I want to retry it after a certain amount of time, and fail the item into a DLQ after a certain amount of retries. I do not want to retry immediately.

I have a worker EB app which processes these tasks. When it succeeds, I return 200 (and the task is successfully removed from the queue). When it fails I return 404, and the task is immediately returned to the queue (and, thus, immediately retried). This is not desired, I'd like to delay this failed item before it is retried.

Is it possible to do this with a combination of visibility timeouts and delay queues?




Aucun commentaire:

Enregistrer un commentaire