SQS compatibility
The SQS operations, queue attributes, message attributes and errors the SQS endpoint supports, and the IAM action each operation needs.
The endpoint accepts POST requests of SQS's JSON protocol (X-Amz-Target: AmazonSQS.<Operation>)
signed with Signature Version 4 for service sqs. Names on the wire are SQS's. How to connect is in
Use an SQS client.
Operations
| Operation | IAM action |
|---|---|
CreateQueue |
queue:CreateQueue |
GetQueueUrl |
queue:GetQueueAttributes |
ListQueues |
queue:ListQueues |
GetQueueAttributes |
queue:GetQueueAttributes |
SetQueueAttributes |
queue:SetQueueAttributes |
DeleteQueue |
queue:DeleteQueue |
PurgeQueue |
queue:PurgeQueue |
ListQueueTags (always answers no tags) |
queue:GetQueueAttributes |
SendMessage, SendMessageBatch |
queue:SendMessage |
ReceiveMessage |
queue:ReceiveMessage |
DeleteMessage, DeleteMessageBatch |
queue:DeleteMessage |
ChangeMessageVisibility, ChangeMessageVisibilityBatch |
queue:ChangeMessageVisibility |
ListDeadLetterSourceQueues |
queue:ListDeadLetterSourceQueues |
StartMessageMoveTask |
queue:StartMessageMoveTask, and queue:SendMessage on every destination |
ListMessageMoveTasks (MaxResults 1 to 10, default 1) |
queue:ListMessageMoveTasks |
AddPermission, RemovePermission, TagQueue, UntagQueue and CancelMessageMoveTask answer
UnsupportedOperation; any other operation answers InvalidAction.
StartMessageMoveTask runs the whole redrive before it answers; see
Redrive a dead-letter queue. SourceArn, DestinationArn and a
RedrivePolicy's deadLetterTargetArn take the queue's ARN
(arn:aws:sqs:de1:<organization id>:<queue name>) or its resource name
(rn:ews:de1:<organization id>:queue:queue/<queue name>).
Queue attributes
You can set these with CreateQueue and SetQueueAttributes:
VisibilityTimeout,MessageRetentionPeriod,DelaySeconds,ReceiveMessageWaitTimeSecondsandMaximumMessageSize, in the ranges of Create a queue.RedrivePolicy: JSON withdeadLetterTargetArnandmaxReceiveCount(1 to 1000). An empty string removes the dead-letter queue.- On a FIFO queue,
ContentBasedDeduplication. FifoQueue, at creation only:"true"is required for a.fifoname and refused for any other.SetQueueAttributesrefuses a value that differs from the queue's.DeduplicationScope(queueonly),FifoThroughputLimit(perQueueonly) andSqsManagedSseEnabled(falseonly) are accepted at those values.
Policy and any other attribute answer InvalidAttributeName.
CreateQueue with the name of an existing queue returns its URL when the attributes you pass match
the queue's, and fails with QueueNameExists naming the first attribute that differs. The tags
of a CreateQueue are ignored.
GetQueueAttributes returns the attributes you name in AttributeNames, or all of them with
All; without AttributeNames it returns none. They are QueueArn,
ApproximateNumberOfMessages, ApproximateNumberOfMessagesNotVisible,
ApproximateNumberOfMessagesDelayed, CreatedTimestamp, LastModifiedTimestamp, the five
settings above, SqsManagedSseEnabled (false), RedrivePolicy when the queue has a dead-letter
queue, and on a FIFO queue FifoQueue, ContentBasedDeduplication, DeduplicationScope and
FifoThroughputLimit. Other names SQS knows (Policy, RedriveAllowPolicy, KmsMasterKeyId,
KmsDataKeyReusePeriodSeconds) are left out of the answer; a name SQS does not know answers
InvalidAttributeName.
Messages
- Message attributes keep their data type:
String,NumberorBinary, optionally with a custom label such asNumber.int. At most 10 per message; list values (StringListValues,BinaryListValues) are refused. MD5OfMessageBodyandMD5OfMessageAttributesare computed as SQS computes them, so SDKs that check them accept the answers. A receive returns the message attributes you name inMessageAttributeNames(a name,prefix.*,.*orAll).- A receive returns the system attributes you name in
MessageSystemAttributeNamesorAttributeNames(orAll):SenderId(your organization id),SentTimestamp,ApproximateReceiveCount,ApproximateFirstReceiveTimestamp, in a dead-letter queueDeadLetterQueueSourceArn, and on a FIFO queueMessageGroupId,MessageDeduplicationIdandSequenceNumber. ReceiveRequestAttemptIdon a receive andMaxNumberOfMessagesPerSecondon aStartMessageMoveTaskare accepted and ignored.- A request body may be at most 2 MiB; a larger one answers
BatchRequestTooLong.
Errors
Errors are SQS's: the body's __type names the error (QueueDoesNotExist, QueueNameExists,
ReceiptHandleIsInvalid, OverLimit, …), which the SDKs turn into their exception classes, and
the x-amzn-query-error header carries the classic code (AWS.SimpleQueueService.NonExistentQueue,
…), which boto3 and the AWS CLI report as the error code.
| Error | When |
|---|---|
RequestThrottled |
Your organization sends more requests than the rate limit; see Quotas |
OverLimit |
A capacity limit or the Queues quota is reached |
AccessDenied |
The key's user lacks the IAM action on that queue |
InvalidClientTokenId, SignatureDoesNotMatch, IncompleteSignature, MissingAuthenticationToken, RequestTimeTooSkewed, ExpiredToken |
The signature or the key is not accepted; see Troubleshooting |
InvalidAction |
Not a POST of the JSON protocol, or an unknown operation |