Amazon Simple Queue Service (SQS) is a fully managed message queuing service that enables you to decouple and scale microservices, distributed systems, and serverless applications. SQS eliminates the complexity and overhead associated with managing and operating message-oriented middleware, and empowers developers to focus on differentiating work.
For more information, visit the official AWS SQS page.
When working with AWS SQS, you might encounter the error code AWS.SimpleQueueService.InvalidMessageRetentionPeriod
. This error indicates that the message retention period set for your SQS queue is invalid.
Typically, this error is observed when you attempt to create or update an SQS queue with an invalid message retention period. The operation fails, and the error message is returned.
The AWS.SimpleQueueService.InvalidMessageRetentionPeriod
error occurs when the specified message retention period does not fall within the allowed range. AWS SQS requires the message retention period to be between 60 seconds (1 minute) and 1209600 seconds (14 days).
This error is typically due to a misconfiguration in the queue settings, where the retention period is set outside the permissible range. This could be a result of a typo, incorrect configuration script, or misunderstanding of the allowed values.
To resolve the AWS.SimpleQueueService.InvalidMessageRetentionPeriod
error, follow these steps:
Check the current message retention period setting for your SQS queue. You can do this via the AWS Management Console, AWS CLI, or AWS SDKs.
aws sqs get-queue-attributes --queue-url --attribute-names MessageRetentionPeriod
If the retention period is outside the valid range, update it to a valid value. Use the AWS CLI command below to set a new retention period:
aws sqs set-queue-attributes --queue-url --attributes MessageRetentionPeriod=
Ensure that the <valid-period-in-seconds>
is between 60 and 1209600.
After updating, confirm that the changes have been applied successfully by retrieving the queue attributes again:
aws sqs get-queue-attributes --queue-url --attribute-names MessageRetentionPeriod
Verify that the MessageRetentionPeriod
is now set to a valid value.
For more detailed guidance on configuring SQS queues, refer to the AWS SQS Developer Guide.
If you continue to experience issues, consider reaching out to AWS Support for further assistance.
Let Dr. Droid create custom investigation plans for your infrastructure.
Book Demo