ISQSClient
Interface in AWS.SQS
Interface for SQS service client.
Methods
AddPermission
function AddPermission(const ARequest: ISQSAddPermissionRequest): ISQSAddPermissionResponse; overload;
ISQSAddPermissionRequest → ISQSAddPermissionResponse
Adds a permission to a queue for a specific principal, allowing sharing access to the queue.
This operation generates a policy for you and applies it to the specified queue. When you create a queue, you have full control access rights for the queue. Only you, the owner of the queue, can grant or deny permissions to the queue. An Amazon SQS policy can have a maximum of seven actions per statement. Specifying SendMessage, DeleteMessage, or ChangeMessageVisibility also grants permissions for the corresponding batch versions of those actions.
Parameters
| Name | Description |
|---|---|
ARequest | The request object containing the queue URL, permission label, AWS account IDs, and actions to grant. |
Returns
A response object confirming successful addition of the permission policy.
function AddPermission(const AQueueUrl, ALabel: string; const AAWSAccountIds, AActions: TArray<string>): ISQSAddPermissionResponse; overload;
Adds a permission to a queue for a specific principal, allowing sharing access to the queue.
Parameters
| Name | Description |
|---|---|
AQueueUrl | The URL of the Amazon SQS queue to which permissions are added. |
ALabel | The unique identification label for the permission being set (maximum 80 characters). |
AAWSAccountIds | The AWS account numbers of the principals who are to receive permission. |
AActions | The actions to allow for the specified principals. |
Returns
A response object confirming successful addition of the permission policy.
CancelMessageMoveTask
function CancelMessageMoveTask( const ARequest: ISQSCancelMessageMoveTaskRequest): ISQSCancelMessageMoveTaskResponse; overload;
ISQSCancelMessageMoveTaskRequest → ISQSCancelMessageMoveTaskResponse
Cancels a specified message movement task between Amazon SQS queues.
A message movement task can only be cancelled when its current status is RUNNING. Cancelling does not revert messages that have already been moved; it only stops the movement of remaining messages. This operation is currently limited to supporting message redrive from dead-letter queues (DLQs). Only one active message movement task is supported per queue at any given time. The source queue is typically the dead-letter queue, while the destination can be the original source queue or a custom destination queue.
Parameters
| Name | Description |
|---|---|
ARequest | The request object containing the task handle identifier for the message movement task to cancel. |
Returns
A response object containing the approximate number of messages already moved before cancellation.
function CancelMessageMoveTask( const ATaskHandle: string): ISQSCancelMessageMoveTaskResponse; overload;
ISQSCancelMessageMoveTaskResponse
Cancels a specified message movement task using the task handle identifier.
This overload provides a simplified interface for cancelling message movement tasks without creating a full request object. The task can only be cancelled when its status is RUNNING. Cancellation stops future message movement but does not revert messages already moved to the destination queue.
Parameters
| Name | Description |
|---|---|
ATaskHandle | The identifier associated with the message movement task to cancel. This handle is returned when starting a message move task. |
Returns
A response object containing the approximate number of messages already moved before cancellation.
ChangeMessageVisibility
function ChangeMessageVisibility( const ARequest: ISQSChangeMessageVisibilityRequest): ISQSChangeMessageVisibilityResponse; overload;
ISQSChangeMessageVisibilityRequest → ISQSChangeMessageVisibilityResponse
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. Valid range is 0 to 43200 seconds (12 hours). The timeout value is applied immediately but is not saved in memory for that message. If the message is not deleted, the visibility timeout reverts to the original queue timeout value the next time the message is received. Setting VisibilityTimeout to 0 makes the message immediately visible to other consumers. This is useful for making a / message available for reprocessing without waiting for the timeout to expire. An Amazon SQS message has three basic states: sent to a queue, received from a queue (in flight), and deleted from the queue. This operation affects messages in the in flight state.
Parameters
| Name | Description |
|---|---|
ARequest | The request object containing the queue URL, receipt handle, and new visibility timeout value. |
Returns
A response object confirming successful change of the message visibility timeout.
function ChangeMessageVisibility(const AQueueUrl, AReceiptHandle: string; const AVisibilityTimeout: Integer): ISQSChangeMessageVisibilityResponse; overload;
ISQSChangeMessageVisibilityResponse
Changes the visibility timeout of a specified message in a queue to a new value.
Parameters
| Name | Description |
|---|---|
AQueueUrl | The URL of the Amazon SQS queue whose message's visibility is changed. |
AReceiptHandle | The receipt handle associated with the message whose visibility timeout is changed. |
AVisibilityTimeout | The new value for the message's visibility timeout in seconds (0 to 43200). |
Returns
A response object confirming successful change of the message visibility timeout.
ChangeMessageVisibilityBatch
function ChangeMessageVisibilityBatch( const ARequest: ISQSChangeMessageVisibilityBatchRequest): ISQSChangeMessageVisibilityBatchResponse;
ISQSChangeMessageVisibilityBatchRequest → ISQSChangeMessageVisibilityBatchResponse
Changes the visibility timeout of multiple messages in a batch operation.
This is a batch version of ChangeMessageVisibility. You can send up to 10 ChangeMessageVisibility requests with each ChangeMessageVisibilityBatch action. The batch request can result in a combination of successful and unsuccessful actions. You should check for batch errors even when the call returns an HTTP status code of 200. The response includes both successful and failed entries to help you process results appropriately. Each entry in the request must have a unique identifier within the batch. Duplicate identifiers will result in a ESQSBatchEntryIdsNotDistinct error. Common failure reasons include invalid receipt handles, messages not being in flight, invalid visibility timeout values, or messages that have already been deleted.
Parameters
| Name | Description |
|---|---|
ARequest | The request object containing the queue URL and a collection of entries specifying receipt handles and new visibility timeout values for each message. |
Returns
A response object containing collections of successful and failed batch entries, with detailed error information for any failures.
CreateQueue
function CreateQueue( const ARequest: ISQSCreateQueueRequest): ISQSCreateQueueResponse; overload;
ISQSCreateQueueRequest → ISQSCreateQueueResponse
Creates a new standard or FIFO queue with the specified configuration.
If you don't specify the FifoQueue attribute, Amazon SQS creates a standard queue. You cannot change the queue type after creation or convert between standard and FIFO queues. If you specify the name of an existing queue with identical attributes, the action returns the URL of the existing queue instead of creating a new one. If attributes differ, the action will return an error. After creating a queue, you must wait at least one second before the queue can be used. If you delete a queue, you must wait at least 60 seconds before creating a queue with the same name. Queue names must be unique within your account and region, contain up to 80 characters, and use only alphanumeric characters, hyphens, and underscores. FIFO queue names must end with .fifo.
Parameters
| Name | Description |
|---|---|
ARequest | The request object containing the queue name, attributes, and optional tags. |
Returns
A response object containing the URL of the created Amazon SQS queue.
function CreateQueue( const AQueueName: string): ISQSCreateQueueResponse; overload;
Creates a new standard queue with the specified name using default attributes.
This convenience method creates a standard queue with all default attributes. For FIFO queues or custom attributes, use the overload that accepts a request object. Default attributes include 30-second visibility timeout, 4-day message retention, 256KB maximum message size, and no delivery delay.
Parameters
| Name | Description |
|---|---|
AQueueName | The name of the new queue. Must be unique within your account and region. |
Returns
A response object containing the URL of the created Amazon SQS queue.
DeleteMessage
function DeleteMessage( const ARequest: ISQSDeleteMessageRequest): ISQSDeleteMessageResponse; overload;
ISQSDeleteMessageRequest → ISQSDeleteMessageResponse
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. You must use the receipt handle from the most recent time you received the message. Using an old receipt handle will cause the request to succeed, but the message might not be deleted. Amazon SQS can delete a message from a queue even if a visibility timeout setting causes the message to be locked by another consumer. For standard queues, it is possible to receive a message even after you delete it on rare occasions due to the distributed nature of SQS. Your application should be idempotent to handle receiving the same message more than once. Amazon SQS automatically deletes messages left in a queue longer than the retention period configured for the queue.
Parameters
| Name | Description |
|---|---|
ARequest | The request object containing the queue URL and receipt handle of the message to delete. |
Returns
A response object confirming successful deletion of the message.
function DeleteMessage( const AQueueUrl, AReceiptHandle: string): ISQSDeleteMessageResponse; overload;
Deletes the specified message from the specified queue.
This convenience method provides direct parameter access without requiring a request object for simple message deletion scenarios. The receipt handle must be from the most recent time you received the message. Each time you receive a message, it comes with a unique receipt handle.
Parameters
| Name | Description |
|---|---|
AQueueUrl | The URL of the Amazon SQS queue from which the message is deleted. |
AReceiptHandle | The receipt handle associated with the message to delete. |
Returns
A response object confirming successful deletion of the message.
DeleteMessageBatch
function DeleteMessageBatch( const ARequest: ISQSDeleteMessageBatchRequest): ISQSDeleteMessageBatchResponse;
ISQSDeleteMessageBatchRequest → ISQSDeleteMessageBatchResponse
Deletes up to ten messages from the specified queue in a batch operation.
This is a batch version of DeleteMessage. You can delete up to 10 messages with each DeleteMessageBatch request. The result of the action on each message is reported individually in the response. The batch request can result in a combination of successful and unsuccessful actions. You should check for batch errors even when the call returns an HTTP status code of 200. The response includes both successful and failed entries to help you process results appropriately. Each entry in the request must have a unique identifier within the batch. Duplicate identifiers will result in a ESQSBatchEntryIdsNotDistinct error. You must use the receipt handle from the most recent time you received each message. Using old receipt handles will cause individual entries to appear successful, but the messages might not actually be deleted. For standard queues, it is possible to receive a message even after successfully deleting it due to the distributed nature of SQS. Your application should be idempotent to handle receiving the same message more than once. Common failure reasons include invalid receipt handles, messages that have already been deleted, expired receipt handles, or messages that are no longer available in the queue.
Parameters
| Name | Description |
|---|---|
ARequest | The request object containing the queue URL and a collection of entries specifying receipt handles and identifiers for each message to delete. |
Returns
A response object containing collections of successful and failed batch entries, with detailed error information for any failures.
DeleteQueue
function DeleteQueue( const ARequest: ISQSDeleteQueueRequest): ISQSDeleteQueueResponse; overload;
ISQSDeleteQueueRequest → ISQSDeleteQueueResponse
Deletes the specified queue, regardless of the queue's contents.
When you delete a queue, any messages in the queue are no longer available. This action is irreversible and all queue data will be permanently lost. The deletion process takes up to 60 seconds. Requests involving the queue during this period might succeed temporarily, but after 60 seconds the queue and any messages you sent will no longer exist. After deleting a queue, you must wait at least 60 seconds before creating a queue with the same name. Queue URLs and names are case-sensitive. Ensure the queue URL is correct, as this operation cannot be undone.
Parameters
| Name | Description |
|---|---|
ARequest | The request object containing the URL of the Amazon SQS queue to delete. |
Returns
A response object confirming successful deletion of the queue.
function DeleteQueue( const AQueueUrl: string): ISQSDeleteQueueResponse; overload;
Deletes the specified queue, regardless of the queue's contents.
This convenience method provides direct parameter access for simple queue deletion without requiring a request object. When you delete a queue, any messages in the queue are no longer available. The deletion process takes up to 60 seconds to complete. You must wait at least 60 seconds before creating a queue with the same name.
Parameters
| Name | Description |
|---|---|
AQueueUrl | The URL of the Amazon SQS queue to delete. |
Returns
A response object confirming successful deletion of the queue.
GetQueueAttributes
function GetQueueAttributes( const ARequest: ISQSGetQueueAttributesRequest): ISQSGetQueueAttributesResponse; overload;
ISQSGetQueueAttributesRequest → ISQSGetQueueAttributesResponse
Gets attributes for the specified queue.
If no attribute names are specified in the request, the response returns empty results. Specify individual attribute names or use All to retrieve all available attributes. All attribute values are returned as strings and may need to be parsed based on their type. Numeric values are string representations of integers, boolean values are "true" or "false", and timestamps are epoch time in seconds as strings. Approximate message count attributes may not achieve consistency until at least 1 minute after producers stop sending messages due to eventual consistency requirements in the distributed Amazon SQS system. To determine whether a queue is FIFO, check whether the QueueName ends with the .fifo suffix or retrieve the FifoQueue attribute.
Parameters
| Name | Description |
|---|---|
ARequest | The request object containing the queue URL and optional collection of attribute names to retrieve. |
Returns
A response object containing a collection of queue attributes with their corresponding values.
function GetQueueAttributes( const AQueueUrl: string): ISQSGetQueueAttributesResponse; overload;
ISQSGetQueueAttributesResponse
Gets all available attributes for the specified queue.
This convenience method retrieves all available attributes by automatically specifying All as the attribute name, eliminating the need to create arrays or request objects.
Parameters
| Name | Description |
|---|---|
AQueueUrl | The URL of the Amazon SQS queue whose attribute information is retrieved. |
Returns
A response object containing all queue attributes with their corresponding values.
function GetQueueAttributes(const AQueueUrl: string; const AAttributeNames: TArray<string>): ISQSGetQueueAttributesResponse; overload;
ISQSGetQueueAttributesResponse
Gets specified attributes for the specified queue.
This convenience method provides direct parameter access without requiring a request object. If the attribute names array is empty, the response returns empty results. Use All as a single element in the array to retrieve all available attributes, or specify individual attribute names to retrieve only specific values.
Parameters
| Name | Description |
|---|---|
AQueueUrl | The URL of the Amazon SQS queue whose attribute information is retrieved. |
AAttributeNames | A collection of attribute names for which to retrieve information. |
Returns
A response object containing a collection of queue attributes with their corresponding values.
GetQueueUrl
function GetQueueUrl( const ARequest: ISQSGetQueueUrlRequest): ISQSGetQueueUrlResponse; overload;
ISQSGetQueueUrlRequest → ISQSGetQueueUrlResponse
Returns the URL of an existing Amazon SQS queue.
This is useful when you know the queue's name but need to retrieve its URL for further operations. The returned URL is required for all subsequent operations on the queue. To access a queue owned by another AWS account, specify the queue owner's AWS account ID. The queue owner must grant you the necessary permissions to access the queue. Queue names are case-sensitive and must match exactly as they were created. For FIFO queues, the queue name must end with the .fifo suffix. The returned URL format is: https://sqs.{region}.amazonaws.com/{account-id}/{queue-name}
Parameters
| Name | Description |
|---|---|
ARequest | The request object containing the queue name and optional queue owner AWS account ID. |
Returns
A response object containing the URL of the requested queue.
function GetQueueUrl(const AQueueName: string; const AQueueOwnerAWSAccountId: string = ''): ISQSGetQueueUrlResponse; overload;
Returns the URL of an existing Amazon SQS queue.
This convenience method provides direct parameter access without requiring a request object. When the account ID is not specified (empty string), the queue is assumed to be owned by the calling account. For cross-account access, provide the 12-digit AWS account ID of the queue owner and ensure you have the necessary permissions to access the queue.
Parameters
| Name | Description |
|---|---|
AQueueName | The name of the queue for which you want to fetch the URL. |
AQueueOwnerAWSAccountId | The AWS account ID of the account that created the queue. Optional parameter required only for accessing queues owned by another AWS account. |
Returns
A response object containing the URL of the requested queue.
ListDeadLetterSourceQueues
function ListDeadLetterSourceQueues( const ARequest: ISQSListDeadLetterSourceQueuesRequest): ISQSListDeadLetterSourceQueuesResponse; overload;
ISQSListDeadLetterSourceQueuesRequest → ISQSListDeadLetterSourceQueuesResponse
Returns a list of source queues that have the RedrivePolicy queue attribute configured with the specified dead-letter queue.
This operation identifies which source queues are configured to use the specified queue as their dead-letter queue. This is useful for debugging and managing dead-letter queue relationships. The operation supports pagination to handle large numbers of source queues efficiently. If no MaxResults parameter is specified, the response includes a maximum of 1,000 results. Use the NextToken from the response in subsequent requests to retrieve additional pages. Only queues within the same AWS account and region as the dead-letter queue are returned. Source queues must have their RedrivePolicy attribute configured to point to the specified dead-letter queue. For optimal performance and proper dead-letter queue functionality, it is recommended to keep source queues and their associated dead-letter queues within the same AWS account and region. This operation is commonly used for:
- Identifying which queues are dependent on a specific dead-letter queue
- Auditing dead-letter queue relationships in your system
- Troubleshooting message flow and redrive configurations
- Preparing for dead-letter queue redrive operations
Parameters
| Name | Description |
|---|---|
ARequest | The request object containing the dead-letter queue URL and optional pagination parameters. |
Returns
A response object containing a list of source queue URLs and optional pagination information.
function ListDeadLetterSourceQueues( const AQueueUrl: string): ISQSListDeadLetterSourceQueuesResponse; overload;
ISQSListDeadLetterSourceQueuesResponse
Returns a list of source queues that have the RedrivePolicy queue attribute configured with the specified dead-letter queue.
Parameters
| Name | Description |
|---|---|
AQueueUrl | The URL of the dead-letter queue to find source queues for. |
Returns
A response object containing a list of source queue URLs.
function ListDeadLetterSourceQueues(const AQueueUrl: string; const AMaxResults: Integer; const ANextToken: string = ''): ISQSListDeadLetterSourceQueuesResponse; overload;
ISQSListDeadLetterSourceQueuesResponse
Returns a paginated list of source queues that have the RedrivePolicy queue attribute configured with the specified dead-letter queue.
This method provides explicit pagination control for scenarios where you need to process large numbers of source queues in manageable chunks.
Parameters
| Name | Description |
|---|---|
AQueueUrl | The URL of the dead-letter queue to find source queues for. |
AMaxResults | The maximum number of results to return in a single request (1-1000). |
ANextToken | The pagination token from a previous request to continue listing results. |
Returns
A response object containing a list of source queue URLs and optional pagination information.
ListMessageMoveTasks
function ListMessageMoveTasks( const ARequest: ISQSListMessageMoveTasksRequest): ISQSListMessageMoveTasksResponse; overload;
ISQSListMessageMoveTasksRequest → ISQSListMessageMoveTasksResponse
Retrieves the most recent message movement tasks for a specified source queue.
Returns up to 10 of the most recent message movement tasks for the specified queue. Each result includes task status, progress information, and configuration details. This operation is currently limited to supporting message redrive from dead-letter queues (DLQs). Only one active message movement task is supported per queue at any given time. The source queue is typically the dead-letter queue, while the destination can be the original source queue or a custom destination queue.
Parameters
| Name | Description |
|---|---|
ARequest | The request object containing the source queue ARN and optional maximum results limit. |
Returns
A response object containing a list of message movement tasks and their attributes.
function ListMessageMoveTasks( const ASourceArn: TARN): ISQSListMessageMoveTasksResponse; overload;
ISQSListMessageMoveTasksResponse
Retrieves the most recent message movement task for the specified source queue.
This overload provides a simplified interface that returns the single most recent message movement task (default MaxResults = 1) for the specified queue ARN. The source queue is typically a dead-letter queue from which messages are being moved.
Parameters
| Name | Description |
|---|---|
ASourceArn | The ARN of the queue whose message movement tasks are to be listed. |
Returns
A response object containing a list of message movement tasks and their attributes.
function ListMessageMoveTasks(const ASourceArn: TARN; const AMaxResults: Integer): ISQSListMessageMoveTasksResponse; overload;
ISQSListMessageMoveTasksResponse
Retrieves recent message movement tasks for the specified source queue with a custom result limit.
This overload allows specification of the maximum number of tasks to return, providing more control over the result set size without creating a full request object. Returns the most recent tasks first, up to the specified maximum limit.
Parameters
| Name | Description |
|---|---|
ASourceArn | The ARN of the queue whose message movement tasks are to be listed. |
AMaxResults | The maximum number of results to include in the response. Valid values: 1-10. Default: 1. |
Returns
A response object containing a list of message movement tasks and their attributes.
ListQueues
function ListQueues( const ARequest: ISQSListQueuesRequest): ISQSListQueuesResponse; overload;
ISQSListQueuesRequest → ISQSListQueuesResponse
Returns a list of your queues in the current region.
The response includes a maximum of 1000 results by default. If you specify a value for the optional QueueNamePrefix parameter, only queues with names that begin with the specified value are returned. The operation supports pagination to handle large numbers of queues efficiently. Use the MaxResults parameter to control response size and the NextToken parameter to retrieve subsequent pages of results. Only queues owned by the requester in the current AWS region are returned. Cross-account permissions do not apply to this action, so you cannot list queues owned by other AWS accounts. The returned queue URLs can be used directly for subsequent SQS operations such as sending messages, receiving messages, deleting messages, or modifying queue attributes. Common use cases include:
- Discovering existing queues in your account for management or monitoring
- Finding queues with specific naming patterns using prefix filtering
- Auditing queue resources across your AWS infrastructure
- Building queue management dashboards or administrative tools
Parameters
| Name | Description |
|---|---|
ARequest | The request object containing optional filtering criteria and pagination parameters. |
Returns
A response object containing a collection of queue URLs and optional pagination information.
function ListQueues: ISQSListQueuesResponse; overload;
Returns a list of all your queues in the current region.
This convenience method retrieves all queues without filtering or pagination limits, automatically handling multiple requests if necessary.
Returns
A response object containing a collection of all queue URLs.
function ListQueues( const AQueueNamePrefix: string): ISQSListQueuesResponse; overload;
Returns a list of your queues in the current region that match the specified name prefix.
This convenience method provides prefix filtering without requiring a request object. The prefix comparison is case-sensitive and matches from the beginning of the queue name.
Parameters
| Name | Description |
|---|---|
AQueueNamePrefix | A prefix to filter queue names. Only queues with names beginning with this value are returned. |
Returns
A response object containing a collection of matching queue URLs.
function ListQueues(const AQueueNamePrefix: string; const AMaxResults: Integer; const ANextToken: string = ''): ISQSListQueuesResponse; overload;
Returns a paginated list of your queues in the current region with explicit pagination control.
This method provides explicit control over both filtering and pagination, useful for processing large numbers of queues in manageable chunks.
Parameters
| Name | Description |
|---|---|
AQueueNamePrefix | A prefix to filter queue names. Pass empty string for no filtering. |
AMaxResults | The maximum number of results to return in a single request (1-1000). |
ANextToken | The pagination token from a previous request to continue listing results. |
Returns
A response object containing a collection of queue URLs and optional pagination information.
ListQueueTags
function ListQueueTags( const ARequest: ISQSListQueueTagsRequest): ISQSListQueueTagsResponse; overload;
ISQSListQueueTagsRequest → ISQSListQueueTagsResponse
Lists all cost allocation tags added to the specified Amazon SQS queue.
This operation retrieves all tags that have been applied to the queue for cost allocation, resource management, or organizational purposes. Cross-account permissions do not apply to this action. You can only list tags for queues that are owned by your AWS account in the current region. Tags are returned as key-value pairs where both keys and values are case-sensitive strings. If no tags are associated with the queue, an empty collection is returned. Common use cases for queue tags include:
- Cost allocation and billing organization
- Environment identification (e.g., Production, Development, Testing)
- Resource ownership and team assignment
- Project or application categorization
- Compliance and governance tracking The maximum number of tags that can be associated with a queue is 50.
Parameters
| Name | Description |
|---|---|
ARequest | The request object containing the URL of the queue whose tags are to be listed. |
Returns
A response object containing a collection of tag key-value pairs associated with the queue.
function ListQueueTags( const AQueueUrl: string): ISQSListQueueTagsResponse; overload;
Lists all cost allocation tags added to the specified Amazon SQS queue.
This convenience method provides direct parameter access without requiring a request object for simple tag listing scenarios. Tags are returned as case-sensitive key-value string pairs. An empty collection indicates that no tags are currently associated with the queue.
Parameters
| Name | Description |
|---|---|
AQueueUrl | The URL of the queue whose tags are to be listed. |
Returns
A response object containing a collection of tag key-value pairs associated with the queue.
PurgeQueue
function PurgeQueue( const ARequest: ISQSPurgeQueueRequest): ISQSPurgeQueueResponse; overload;
ISQSPurgeQueueRequest → ISQSPurgeQueueResponse
Deletes all available messages in a queue, including in-flight messages.
When you use the PurgeQueue action, you cannot retrieve any messages deleted from the queue. This operation is irreversible and all queue data will be permanently lost. The message deletion process takes up to 60 seconds to complete. We recommend waiting for the full 60 seconds regardless of your queue's size before assuming the purge is complete. Messages sent to the queue before you call PurgeQueue might be received but are deleted within the next minute. Messages sent to the queue after you call PurgeQueue might be deleted while the queue is being purged. This operation deletes both visible messages and in-flight messages (messages that have been received by a consumer but not yet deleted from the queue). Common use cases include:
- Clearing test data from development or staging queues
- Resetting queue state after system errors or failures
- Cleaning up queues before system maintenance
- Removing stale messages during application restarts
Parameters
| Name | Description |
|---|---|
ARequest | The request object containing the URL of the queue to be purged. |
Returns
A response object confirming successful initiation of the purge operation.
function PurgeQueue( const AQueueUrl: string): ISQSPurgeQueueResponse; overload;
Deletes all available messages in a queue, including in-flight messages.
This convenience method provides direct parameter access without requiring a request object for simple queue purging scenarios. The purge operation is irreversible and takes up to 60 seconds to complete. All messages in the queue will be permanently deleted.
Parameters
| Name | Description |
|---|---|
AQueueUrl | The URL of the queue to be purged. |
Returns
A response object confirming successful initiation of the purge operation.
ReceiveMessage
function ReceiveMessage( const ARequest: ISQSReceiveMessageRequest): ISQSReceiveMessageResponse; overload;
ISQSReceiveMessageRequest → ISQSReceiveMessageResponse
Retrieves one or more messages from the specified queue.
This operation retrieves up to 10 messages from the queue. Using the WaitTimeSeconds parameter enables long polling support, which can reduce costs and improve efficiency. Short polling (default behavior) uses a weighted random set of machines, so only messages on the sampled machines are returned. If the queue has fewer than 1,000 messages, you will likely receive fewer messages than requested per call. Each retrieved message includes:
- Message body and an MD5 digest of the message body
- Message ID and receipt handle for message management
- Requested system attributes (timestamps, receive counts, etc.)
- Requested message attributes and their MD5 digest
Retrieved messages become temporarily invisible to other consumers based on the queue's visibility timeout or the
VisibilityTimeoutparameter. Messages must be explicitly / deleted using the receipt handle, or they will become visible again after the timeout expires. For FIFO queues, this operation supports exactly-once receive semantics using theReceiveRequestAttemptIdparameter for network error recovery scenarios. If no messages are available, the response will contain an empty message collection. This is normal behavior and indicates the queue is currently empty.
Parameters
| Name | Description |
|---|---|
ARequest | The request object containing the queue URL and optional parameters for message retrieval. |
Returns
A response object containing retrieved messages and their associated metadata.
function ReceiveMessage( const AQueueUrl: string): ISQSReceiveMessageResponse; overload;
Retrieves a single message from the specified queue using default settings.
This convenience method retrieves one message using default settings: short polling, default visibility timeout, and no specific attributes requested. For more control over the receive operation (such as long polling, multiple messages, or specific attributes), use the overload that accepts a request object.
Parameters
| Name | Description |
|---|---|
AQueueUrl | The URL of the Amazon SQS queue from which to receive messages. |
Returns
A response object containing retrieved messages and their associated metadata.
RemovePermission
function RemovePermission( const ARequest: ISQSRemovePermissionRequest): ISQSRemovePermissionResponse; overload;
ISQSRemovePermissionRequest → ISQSRemovePermissionResponse
Revokes any permissions in the queue policy that match the specified label parameter.
This operation removes permissions from the queue policy that were previously added using the AddPermission action with the specified label. Only the owner of a queue can remove permissions from it. You cannot remove permissions from queues owned by other AWS accounts, even if you have been granted access to those queues. The label matching is case-sensitive and must exactly match the label used when the permission was originally added. If no permission with the specified label exists, the operation succeeds without error but makes no changes to the queue policy. Cross-account permissions do not apply to this action. This operation can only be performed by the queue owner within their own AWS account. To completely prevent permission changes, you must deny the AddPermission, RemovePermission, and SetQueueAttributes actions in your IAM policies. This operation modifies the queue's access policy and changes take effect immediately. Any principals that were using the removed permission will lose access immediately.
Parameters
| Name | Description |
|---|---|
ARequest | The request object containing the queue URL and permission label to remove. |
Returns
A response object confirming successful removal of the permission.
function RemovePermission( const AQueueUrl, ALabel: string): ISQSRemovePermissionResponse; overload;
Revokes any permissions in the queue policy that match the specified label parameter.
This convenience method provides direct parameter access without requiring a request object for simple permission removal scenarios. Only the queue owner can remove permissions, and the label must exactly match the label used when the permission was originally added with AddPermission.
Parameters
| Name | Description |
|---|---|
AQueueUrl | The URL of the Amazon SQS queue from which permissions are removed. |
ALabel | The identification of the permission to remove. |
Returns
A response object confirming successful removal of the permission.
SendMessage
function SendMessage( const ARequest: ISQSSendMessageRequest): ISQSSendMessageResponse; overload;
ISQSSendMessageRequest → ISQSSendMessageResponse
Delivers a message to the specified Amazon SQS queue.
Messages can include only XML, JSON, and unformatted text with specific Unicode characters. The message body must be between 1 character and 1 MiB (1,048,576 bytes) in size. For FIFO queues, MessageGroupId is required and MessageDeduplicationId may be required depending on queue configuration.
Parameters
| Name | Description |
|---|---|
ARequest | The request object containing the queue URL, message body, and optional parameters such as delay seconds, message attributes, and FIFO queue settings. |
Returns
A response object containing the message ID, MD5 checksums for verification, and sequence number for FIFO queues.
function SendMessage( const AQueueUrl, AMessageBody: string): ISQSSendMessageResponse; overload;
Delivers a message to the specified Amazon SQS queue using basic parameters.
This overload provides a simplified interface for sending basic messages without additional attributes or delay settings. The queue's default configuration applies for delay seconds and other optional parameters. For FIFO queues, this method cannot be used as MessageGroupId is required. Use the full request object overload instead.
Parameters
| Name | Description |
|---|---|
AQueueUrl | The URL of the Amazon SQS queue to which the message is sent. Queue URLs are case-sensitive. |
AMessageBody | The message content to send. Must be between 1 character and 1 MiB in size and contain only valid Unicode characters. |
Returns
A response object containing the message ID, MD5 checksums for verification, and sequence number for FIFO queues.
SendMessageBatch
function SendMessageBatch( const ARequest: ISQSSendMessageBatchRequest): ISQSSendMessageBatchResponse;
ISQSSendMessageBatchRequest → ISQSSendMessageBatchResponse
Delivers up to 10 messages to the specified Amazon SQS queue in a single batch operation.
This is the batch version of SendMessage that optimizes performance and reduces costs by processing multiple messages simultaneously. The maximum total payload size (sum of all message lengths) is 1 MiB (1,048,576 bytes). For FIFO queues, messages within a single batch are enqueued in the order they are sent. Each message result is reported individually in the response. Batch requests can result in a combination of successful and unsuccessful actions. Always check both successful and failed collections in the response, even when the call returns an HTTP status code of 200.
Parameters
| Name | Description |
|---|---|
ARequest | The batch request object containing the queue URL and a list of message entries to send. Each entry must have a unique identifier and message body within the batch. |
Returns
A response object containing lists of successfully processed and failed message entries, with detailed results and error information for each message in the batch.
SetQueueAttributes
function SetQueueAttributes( const ARequest: ISQSSetQueueAttributesRequest): ISQSSetQueueAttributesResponse;
ISQSSetQueueAttributesRequest → ISQSSetQueueAttributesResponse
Sets the value of one or more queue attributes for the specified Amazon SQS queue.
Attribute changes can take up to 60 seconds to propagate throughout the Amazon SQS system. Changes to MessageRetentionPeriod can take up to 15 minutes and may impact existing messages in the queue, potentially causing them to expire and be deleted. Supports configuration of standard queue attributes such as DelaySeconds, VisibilityTimeout, and MessageRetentionPeriod, as well as specialized attributes for dead-letter queues, server-side encryption, and FIFO queue behavior. Cross-account permissions do not apply to this operation. To restrict queue attribute modifications, deny AddPermission, RemovePermission, and SetQueueAttributes actions in IAM policies.
Parameters
| Name | Description |
|---|---|
ARequest | The request object containing the queue URL and a map of attributes to set with their values. |
Returns
A response object indicating successful completion of the attribute update operation.
StartMessageMoveTask
function StartMessageMoveTask( const ARequest: ISQSStartMessageMoveTaskRequest): ISQSStartMessageMoveTaskResponse; overload;
ISQSStartMessageMoveTaskRequest → ISQSStartMessageMoveTaskResponse
Starts an asynchronous task to move messages from a specified source queue to a destination queue.
This operation is currently limited to supporting message redrive from dead-letter queues (DLQs) that are configured as DLQs of other Amazon SQS queues. Only one active message movement task is supported per queue at any given time. The source queue must be a dead-letter queue, while the destination can be the original source queue or a custom destination queue. If no destination is specified, messages are redriven back to their respective original source queues. Use the returned task handle to monitor progress with ListMessageMoveTasks or cancel the operation with CancelMessageMoveTask.
Parameters
| Name | Description |
|---|---|
ARequest | The request object containing the source queue ARN, optional destination ARN, and optional rate limiting configuration. |
Returns
A response object containing the task handle identifier for tracking and cancelling the message movement task.
function StartMessageMoveTask( const ASourceArn: TARN): ISQSStartMessageMoveTaskResponse; overload;
ISQSStartMessageMoveTaskResponse
Starts an asynchronous task to move messages from a dead-letter queue back to their original source queues.
This overload provides a simplified interface for redriving messages back to their original source queues without specifying a custom destination. The system will automatically determine the appropriate destination queues. The message movement rate will be optimized automatically based on queue backlog size.
Parameters
| Name | Description |
|---|---|
ASourceArn | The ARN of the dead-letter queue containing the messages to be moved. |
Returns
A response object containing the task handle identifier for tracking and cancelling the message movement task.
function StartMessageMoveTask( const ASourceArn, ADestinationArn: TARN): ISQSStartMessageMoveTaskResponse; overload;
ISQSStartMessageMoveTaskResponse
Starts an asynchronous task to move messages from a source dead-letter queue to a specific destination queue.
This overload allows specification of a custom destination queue for message redrive, providing control over where messages are moved without rate limiting configuration. The message movement rate will be optimized automatically based on queue backlog size.
Parameters
| Name | Description |
|---|---|
ASourceArn | The ARN of the dead-letter queue containing the messages to be moved. |
ADestinationArn | The ARN of the queue that will receive the moved messages. Can be the original source queue or a custom destination. |
Returns
A response object containing the task handle identifier for tracking and cancelling the message movement task.
function StartMessageMoveTask(const ASourceArn, ADestinationArn: TARN; const AMaxNumberOfMessagesPerSecond: Integer): ISQSStartMessageMoveTaskResponse; overload;
ISQSStartMessageMoveTaskResponse
Starts an asynchronous task to move messages with a specified rate limit between source and destination queues.
This overload provides full control over message movement including custom destination and rate limiting to manage the impact on system resources and downstream consumers. Rate limiting helps prevent overwhelming the destination queue or downstream applications when moving large volumes of messages.
Parameters
| Name | Description |
|---|---|
ASourceArn | The ARN of the dead-letter queue containing the messages to be moved. |
ADestinationArn | The ARN of the queue that will receive the moved messages. Can be the original source queue or a custom destination. |
AMaxNumberOfMessagesPerSecond | The maximum number of messages to move per second. Valid values: 1-500. Controls the message movement throughput rate. |
Returns
A response object containing the task handle identifier for tracking and cancelling the message movement task.
TagQueue
function TagQueue( const ARequest: ISQSTagQueueRequest): ISQSTagQueueResponse;
ISQSTagQueueRequest → ISQSTagQueueResponse
Adds cost allocation tags to the specified Amazon SQS queue.
Tags are key-value pairs used for cost allocation and resource organization. Amazon SQS interprets tags as character strings without semantic meaning. Adding more than 50 tags to a queue is not recommended. Tags are case-sensitive, and new tags with keys identical to existing tags will overwrite the existing tags. Cross-account permissions do not apply to this operation. For complete tag restrictions and quotas, see the Amazon SQS Developer Guide.
Parameters
| Name | Description |
|---|---|
ARequest | The request object containing the queue URL and a map of tags to add to the queue. |
Returns
A response object indicating successful completion of the tag operation.
UntagQueue
function UntagQueue( const ARequest: ISQSUntagQueueRequest): ISQSUntagQueueResponse; overload;
ISQSUntagQueueRequest → ISQSUntagQueueResponse
Removes cost allocation tags from the specified Amazon SQS queue.
Only the tag keys need to be specified for removal. The corresponding tag values are automatically removed when the keys are deleted. Tags are case-sensitive, so the tag keys must match exactly with existing tags. If a specified tag key does not exist on the queue, the operation will still succeed without error. Cross-account permissions do not apply to this operation.
Parameters
| Name | Description |
|---|---|
ARequest | The request object containing the queue URL and an array of tag keys to remove from the queue. |
Returns
A response object indicating successful completion of the tag removal operation.
function UntagQueue(const AQueueUrl: string; const ATagKeys: TArray<string>): ISQSUntagQueueResponse; overload;
Removes cost allocation tags from the specified Amazon SQS queue using basic parameters.
This overload provides a simplified interface for removing tags without creating a full request object. Tags are case-sensitive and must match existing tag keys exactly. If any specified tag key does not exist on the queue, the operation will still succeed without error for the remaining valid keys.
Parameters
| Name | Description |
|---|---|
AQueueUrl | The URL of the Amazon SQS queue from which tags will be removed. Queue URLs are case-sensitive. |
ATagKeys | An array of tag keys to remove from the queue. Only the keys are required; corresponding values are automatically removed. |
Returns
A response object indicating successful completion of the tag removal operation.