SQS class

Welcome to the Amazon Simple Queue Service API Reference.

Amazon Simple Queue Service (Amazon SQS) is a reliable, highly-scalable hosted queue for storing messages as they travel between applications or microservices. Amazon SQS moves data between distributed application components and helps you decouple these components.

For information on the permissions you need to use this API, see Identity and access management in the Amazon Simple Queue Service Developer Guide.

You can use AWS SDKs to access Amazon SQS using your favorite programming language. The SDKs perform tasks such as the following automatically:

  • Cryptographically sign your service requests
  • Retry requests
  • Handle error responses
Additional Information

Constructors

SQS({required String region, AwsClientCredentials? credentials, AwsClientCredentialsProvider? credentialsProvider, Client? client, String? endpointUrl})

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shapes Map<String, Shape>
final

Methods

addPermission({required List<String> awsAccountIds, required List<String> actions, required String label, required String queueUrl}) Future<void>
Adds a permission to a queue for a specific principal. This allows sharing access to the queue.
changeMessageVisibility({required String queueUrl, required String receiptHandle, required int visibilityTimeout}) Future<void>
Changes the visibility timeout of a specified message in a queue to a new value. The default visibility timeout for a message is 30 seconds. The minimum is 0 seconds. The maximum is 12 hours. For more information, see Visibility Timeout in the Amazon Simple Queue Service Developer Guide.
changeMessageVisibilityBatch({required List<ChangeMessageVisibilityBatchRequestEntry> entries, required String queueUrl}) Future<ChangeMessageVisibilityBatchResult>
Changes the visibility timeout of multiple messages. This is a batch version of ChangeMessageVisibility. The result of the action on each message is reported individually in the response. You can send up to 10 ChangeMessageVisibility requests with each ChangeMessageVisibilityBatch action. Some actions take lists of parameters. These lists are specified using the param.n notation. Values of n are integers starting from 1. For example, a parameter list with two elements looks like this:
close() → void
Closes the internal HTTP client if none was provided at creation. If a client was passed as a constructor argument, this becomes a noop.
createQueue({required String queueName, Map<QueueAttributeName, String>? attributes, Map<String, String>? tags}) Future<CreateQueueResult>
Creates a new standard or FIFO queue. You can pass one or more attributes in the request. Keep the following in mind:
deleteMessage({required String queueUrl, required String receiptHandle}) Future<void>
Deletes the specified message from the specified queue. To select the message to delete, use the ReceiptHandle of the message (not the MessageId which you receive when you send the message). Amazon SQS can delete a message from a queue even if a visibility timeout setting causes the message to be locked by another consumer. Amazon SQS automatically deletes messages left in a queue longer than the retention period configured for the queue.
deleteMessageBatch({required List<DeleteMessageBatchRequestEntry> entries, required String queueUrl}) Future<DeleteMessageBatchResult>
Deletes up to ten messages from the specified queue. This is a batch version of DeleteMessage. The result of the action on each message is reported individually in the response. Some actions take lists of parameters. These lists are specified using the param.n notation. Values of n are integers starting from 1. For example, a parameter list with two elements looks like this:
deleteQueue({required String queueUrl}) Future<void>
Deletes the queue specified by the QueueUrl, regardless of the queue's contents. When you delete a queue, the deletion process takes up to 60 seconds. Requests you send involving that queue during the 60 seconds might succeed. For example, a SendMessage request might succeed, but after 60 seconds the queue and the message you sent no longer exist.
getQueueAttributes({required String queueUrl, List<QueueAttributeName>? attributeNames}) Future<GetQueueAttributesResult>
Gets attributes for the specified queue.
getQueueUrl({required String queueName, String? queueOwnerAWSAccountId}) Future<GetQueueUrlResult>
Returns the URL of an existing Amazon SQS queue.
listDeadLetterSourceQueues({required String queueUrl, int? maxResults, String? nextToken}) Future<ListDeadLetterSourceQueuesResult>
Returns a list of your queues that have the RedrivePolicy queue attribute configured with a dead-letter queue.
listQueues({int? maxResults, String? nextToken, String? queueNamePrefix}) Future<ListQueuesResult>
Returns a list of your queues in the current region. The response includes a maximum of 1,000 results. If you specify a value for the optional QueueNamePrefix parameter, only queues with a name that begins with the specified value are returned.
listQueueTags({required String queueUrl}) Future<ListQueueTagsResult>
List all cost allocation tags added to the specified Amazon SQS queue. For an overview, see Tagging Your Amazon SQS Queues in the Amazon Simple Queue Service Developer Guide.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
purgeQueue({required String queueUrl}) Future<void>
Deletes the messages in a queue specified by the QueueURL parameter.
receiveMessage({required String queueUrl, List<QueueAttributeName>? attributeNames, int? maxNumberOfMessages, List<String>? messageAttributeNames, String? receiveRequestAttemptId, int? visibilityTimeout, int? waitTimeSeconds}) Future<ReceiveMessageResult>
Retrieves one or more messages (up to 10), from the specified queue. Using the WaitTimeSeconds parameter enables long-poll support. For more information, see Amazon SQS Long Polling in the Amazon Simple Queue Service Developer Guide.
removePermission({required String label, required String queueUrl}) Future<void>
Revokes any permissions in the queue policy that matches the specified Label parameter.
sendMessage({required String messageBody, required String queueUrl, int? delaySeconds, Map<String, MessageAttributeValue>? messageAttributes, String? messageDeduplicationId, String? messageGroupId, Map<MessageSystemAttributeNameForSends, MessageSystemAttributeValue>? messageSystemAttributes}) Future<SendMessageResult>
Delivers a message to the specified queue.
sendMessageBatch({required List<SendMessageBatchRequestEntry> entries, required String queueUrl}) Future<SendMessageBatchResult>
Delivers up to ten messages to the specified queue. This is a batch version of SendMessage. For a FIFO queue, multiple messages within a single batch are enqueued in the order they are sent.
setQueueAttributes({required Map<QueueAttributeName, String> attributes, required String queueUrl}) Future<void>
Sets the value of one or more queue attributes. When you change a queue's attributes, the change can take up to 60 seconds for most of the attributes to propagate throughout the Amazon SQS system. Changes made to the MessageRetentionPeriod attribute can take up to 15 minutes.
tagQueue({required String queueUrl, required Map<String, String> tags}) Future<void>
Add cost allocation tags to the specified Amazon SQS queue. For an overview, see Tagging Your Amazon SQS Queues in the Amazon Simple Queue Service Developer Guide.
toString() String
A string representation of this object.
inherited
untagQueue({required String queueUrl, required List<String> tagKeys}) Future<void>
Remove cost allocation tags from the specified Amazon SQS queue. For an overview, see Tagging Your Amazon SQS Queues in the Amazon Simple Queue Service Developer Guide.

Operators

operator ==(Object other) bool
The equality operator.
inherited