CancelMessageMoveTask - Amazon Simple Queue Service (original) (raw)

Cancels a specified message movement task. A message movement can only be cancelled when the current status is RUNNING. Cancelling a message movement task does not revert the messages that have already been moved. It can only stop the messages that have not been moved yet.

Note

Request Syntax

{
   "TaskHandle": "string"
}

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

TaskHandle

An identifier associated with a message movement task.

Type: String

Required: Yes

Response Syntax

{
   "ApproximateNumberOfMessagesMoved": number
}

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

ApproximateNumberOfMessagesMoved

The approximate number of messages already moved to the destination queue.

Type: Long

Errors

For information about the errors that are common to all actions, see Common Errors.

InvalidAddress

The specified ID is invalid.

HTTP Status Code: 400

InvalidSecurity

The request was not made over HTTPS or did not use SigV4 for signing.

HTTP Status Code: 400

RequestThrottled

The request was denied due to request throttling.

HTTP Status Code: 400

ResourceNotFoundException

One or more specified resources don't exist.

HTTP Status Code: 400

UnsupportedOperation

Error code 400. Unsupported operation.

HTTP Status Code: 400

Examples

Example

Using AWS query protocol

The following example query cancels an existing running message move task. The structure of AUTHPARAMS depends on the signature of the API request. For more information, see Examples of Signed Signature Version 4 Requests in the AWS General Reference.

Sample Request

POST / HTTP/1.1
Host: sqs.us-east-1.amazonaws.com
X-Amz-Date: <Date>
Content-Type: application/x-www-form-urlencoded
Authorization: <AuthParams>
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive 
Action=CancelMessageMoveTask
&TaskHandle=eyJ0YXNrSWQiOiJkYzE2OWUwNC0wZTU1LTQ0ZDItYWE5MC1jMDgwY2ExZjM2ZjciLCJzb3VyY2VBcm4iOiJhcm46YXdzOnNxczp1cy1lYXN0LTE6MTc3NzE1MjU3NDM2Ok15RGVhZExldHRlclF1ZXVlIn0=

Sample Response

HTTP/1.1 200 OK
<?xml version="1.0"?>
<CancelMessageMoveTaskResponse xmlns="http://queue.amazonaws.com/doc/2012-11-05/">
    <CancelMessageMoveTaskResult>
        <ApproximateNumberOfMessagesMoved>300</ApproximateNumberOfMessagesMoved>
    </CancelMessageMoveTaskResult>
    <ResponseMetadata>
        <RequestId>9b20926c-8b35-5d8e-9559-ce1c22e754dc</RequestId>
    </ResponseMetadata>
</CancelMessageMoveTaskResponse>

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: