Skip to content

SQS

CloudMock emulates Amazon SQS, a fully managed message queuing service, supporting queue lifecycle, message send/receive/delete, visibility timeouts, and batch operations.

OperationStatusNotes
CreateQueueSupportedCreates a standard queue
DeleteQueueSupportedDeletes a queue and all its messages
ListQueuesSupportedReturns queue URLs with optional prefix filter
GetQueueUrlSupportedReturns the URL of a named queue
GetQueueAttributesSupportedReturns queue attributes (ApproximateNumberOfMessages, etc.)
SetQueueAttributesSupportedSets queue attributes (VisibilityTimeout, etc.)
SendMessageSupportedSends a single message
ReceiveMessageSupportedReturns up to 10 messages; marks them invisible
DeleteMessageSupportedPermanently removes a received message using its receipt handle
PurgeQueueSupportedDeletes all messages in the queue
ChangeMessageVisibilitySupportedExtends or resets visibility timeout
SendMessageBatchSupportedSends up to 10 messages in one call
DeleteMessageBatchSupportedDeletes up to 10 messages in one call
Terminal window
# Create a queue
curl -X POST "http://localhost:4566/?Action=CreateQueue&QueueName=my-queue"
# Send a message
curl -X POST "http://localhost:4566/000000000000/my-queue?Action=SendMessage&MessageBody=Hello"
# Receive messages
curl -X POST "http://localhost:4566/000000000000/my-queue?Action=ReceiveMessage&MaxNumberOfMessages=5"
import { SQSClient, CreateQueueCommand, SendMessageCommand, ReceiveMessageCommand } from '@aws-sdk/client-sqs';
const sqs = new SQSClient({
endpoint: 'http://localhost:4566',
region: 'us-east-1',
credentials: { accessKeyId: 'test', secretAccessKey: 'test' },
});
const { QueueUrl } = await sqs.send(new CreateQueueCommand({ QueueName: 'jobs' }));
await sqs.send(new SendMessageCommand({ QueueUrl, MessageBody: '{"job":"process"}' }));
const { Messages } = await sqs.send(new ReceiveMessageCommand({ QueueUrl, MaxNumberOfMessages: 10 }));
import boto3
sqs = boto3.client('sqs', endpoint_url='http://localhost:4566',
aws_access_key_id='test', aws_secret_access_key='test',
region_name='us-east-1')
response = sqs.create_queue(QueueName='jobs')
url = response['QueueUrl']
sqs.send_message(QueueUrl=url, MessageBody='{"job": "process-image"}')
messages = sqs.receive_message(QueueUrl=url, MaxNumberOfMessages=10).get('Messages', [])
for msg in messages:
print(msg['Body'])
sqs.delete_message(QueueUrl=url, ReceiptHandle=msg['ReceiptHandle'])
cloudmock.yml
services:
sqs:
enabled: true

No additional service-specific configuration is required.

  • Queue URLs follow the pattern http://localhost:4566/{AccountId}/{QueueName}.
  • VisibilityTimeout is enforced — messages that are not deleted within the timeout reappear in the queue.
  • FIFO queues are accepted at creation but do not enforce ordering or deduplication.
  • Dead-letter queue redrive is not implemented.
  • Message attributes are stored and returned but not used for filtering.
  • Long polling (WaitTimeSeconds) is accepted but returns immediately.
CodeHTTP StatusDescription
AWS.SimpleQueueService.NonExistentQueue400The specified queue does not exist
QueueAlreadyExists400A queue with this name already exists
ReceiptHandleIsInvalid400The receipt handle provided is not valid
EmptyBatchRequest400The batch request contains no entries