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.
When working with AWS SQS, you might encounter the error code AWS.SimpleQueueService.InvalidMaximumMessageSize
. This error typically manifests when you attempt to set a message size that is outside the allowed range.
Developers may see an error message indicating that the maximum message size is invalid when trying to configure or send messages through SQS.
The error AWS.SimpleQueueService.InvalidMaximumMessageSize
occurs when the maximum message size specified for an SQS queue is not within the permissible limits. AWS SQS supports message sizes ranging from 1 KB (1024 bytes) to 256 KB (262144 bytes).
This issue arises when the configuration of the queue attempts to set a maximum message size that is either too small or too large, violating the constraints set by AWS SQS.
To resolve this issue, you need to ensure that the maximum message size is set within the valid range. Follow these steps:
Check the current configuration of your SQS queue to see what the maximum message size is set to. You can do this via the AWS Management Console or AWS CLI.
aws sqs get-queue-attributes --queue-url --attribute-names All
Look for the MaximumMessageSize
attribute in the output.
If the current setting is outside the valid range, update it using the AWS CLI:
aws sqs set-queue-attributes --queue-url --attributes MaximumMessageSize=262144
This command sets the maximum message size to 256 KB, which is the upper limit.
After updating, verify that the changes have been applied correctly by running the get-queue-attributes
command again.
For more information on configuring SQS queues, refer to the AWS SQS Developer Guide.
To learn more about AWS CLI commands for SQS, visit the AWS CLI Command Reference.
Let Dr. Droid create custom investigation plans for your infrastructure.
Book Demo