Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does "SentTimestamp" attribute of AWS SQS message change after visibility timeout?

While using AWS SQS, does "SentTimestamp" attribute of a message change after it is received from the queue, but not deleted and returned back to the queue after the visibility timeout expired?

like image 658
aozturk Avatar asked Oct 24 '25 15:10

aozturk


1 Answers

No, and that behavior would be undesirable because SentTimestamp specifically describes when the message was first sent to the queue.

This documentation that describes the visibility timeout offers some insight:

Immediately after the component receives the message, the message is still in the queue. However, you don't want other components in the system receiving and processing the message again. Therefore, Amazon SQS blocks them with a visibility timeout, which is a period of time during which Amazon SQS prevents other consuming components from receiving and processing that message.

The important takeaway here is that the message never really leaves the queue, it is simply hidden from other clients that are receiving messages. So message contents like the MessageID and SentTimeout won't change. On the other hand, things related to receiving the message like RecieptHandle and Receive Count do change each time the message is received.

You can self-verify this from the AWS web console by:

  • Creating a message in a queue.
  • Viewing the message.
  • Waiting for the visibility timeout to expire. Once it has, open the SQS console again in a new tab.
  • Viewing the message again, in the new tab. Compare the contents of both received messages.
like image 172
Anthony Neace Avatar answered Oct 27 '25 06:10

Anthony Neace