63.8k views
4 votes
How long can I keep my messages in Amazon SQS message queues?

User Guy Gordon
by
8.1k points

1 Answer

2 votes

Final answer:

You can keep your messages in Amazon SQS message queues for up to 14 days, with the default being four days, which applies to both standard and FIFO queues. This retention period is adjustable within the given limits.

Step-by-step explanation:

The duration for which you can keep your messages in Amazon SQS message queues depends on the type of queue you are using. For standard queues, the default retention period is four days, but it can be configured to be as short as 60 seconds or as long as 14 days. On the other hand, FIFO (First-In-First-Out) queues have the same default retention period, and it can also be adjusted within the same range. Once a message is delivered to the receiving components and successfully processed, it should be deleted from the queue to avoid reprocessing. However, if a message is not processed within the retention period, Amazon SQS automatically deletes it. Amazon SQS Message Retention

In Amazon Simple Queue Service (SQS), the retention period for messages in the message queue is defaulted to 4 days. This means that once a message is sent to the queue, it will be retained for up to 4 days before it gets deleted.

However, you can also set a custom retention period for your queues, which can range from 1 minute to 14 days. This allows you to control how long messages are stored in the queue before they are automatically deleted.

For example, if you want to set a retention period of 1 hour for a specific message queue, you can configure it using the SQS console or the AWS SDKs.

User Ikue
by
7.3k points