1
votes

Consider a queue.

I have j1...jn jobs (or messages) in the queue.

I am aware when j completes, in this case I delete them.

I am also aware when j do not complete and in this case, I do not delete them intentionally so it gets back into the queue.

I would like to keep an unfinished job forever in the queue, however, I am aware that there is a retention period for j. I am also aware of DLQ, but do not wish to implement it because it's not an error (no need to look & debug).

My questions are:

  1. Will jobs that are read and never deleted be assigned a fresh retention period (after it's read or after it's requeued)?
  2. Will deleting a message and sending message with same instruction (or message body) have a refreshed retention period?
1

1 Answers

6
votes

The maximum retention period of a message in an Amazon SQS queue is 14 days. This is from the time is placed into the queue, regardless of whether it has been read and whether the visibility has changed. (Admittedly, I could not find any documentation that specifically states this.)

If a message is deleted from the queue and a new messages is sent into the queue, then this new message will be treated as a different message with its own retention period.

So, you could theoretically Receive, Delete and Send a message to "keep" it in the queue, but this really defeats the architectural purpose of a queue. If you are retaining information for long periods, some form of Database would be advisable.