Skip to content

cancel_message_move_task async

cancel_message_move_task(
    task_handle: String, *, config_overrides: Optional[AsyncSQSClientConfig] = None
) -> CancelMessageMoveTaskResult

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.

  • This action is currently limited to supporting message redrive from dead-letter queues (DLQs) only. In this context, the source queue is the dead-letter queue (DLQ), while the destination queue can be the original source queue (from which the messages were driven to the dead-letter-queue), or a custom destination queue.

  • Only one active message movement task is supported per queue at any given time.

Parameters:

  • task_handle (String) –

    An identifier associated with a message movement task.

Raises:

  • InvalidAddress –

    The specified ID is invalid.

  • InvalidSecurity –

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

  • RequestThrottled –

    The request was denied due to request throttling.

    • Exceeds the permitted request rate for the queue or for the recipient of the request.

    • Ensure that the request rate is within the Amazon SQS limits for sending messages. For more information, see Amazon SQS quotas in the Amazon SQS Developer Guide.

  • ResourceNotFoundException –

    One or more specified resources don't exist.

  • UnsupportedOperation –

    Error code 400. Unsupported operation.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_sqs/_services/async_sqs.py
async def cancel_message_move_task(
    self,
    task_handle: "capo_sqs.types.string.String",
    *,
    config_overrides: Optional[AsyncSQSClientConfig] = None,
) -> "capo_sqs.types.cancel_message_move_task_result.CancelMessageMoveTaskResult":
    """<p>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.</p> <note> <ul> <li> <p>This action is currently limited to supporting message redrive from <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html">dead-letter queues (DLQs)</a> only. In this context, the source queue is the dead-letter queue (DLQ), while the destination queue can be the original source queue (from which the messages were driven to the dead-letter-queue), or a custom destination queue. </p> </li> <li> <p>Only one active message movement task is supported per queue at any given time.</p> </li> </ul> </note>

    Args:
        task_handle: <p>An identifier associated with a message movement task.</p>

    Raises:
        capo_sqs.errors.invalid_address.InvalidAddress: <p>The specified ID is invalid.</p>
        capo_sqs.errors.invalid_security.InvalidSecurity: <p>The request was not made over HTTPS or did not use SigV4 for signing.</p>
        capo_sqs.errors.request_throttled.RequestThrottled: <p>The request was denied due to request throttling.</p> <ul> <li> <p>Exceeds the permitted request rate for the queue or for the recipient of the request.</p> </li> <li> <p>Ensure that the request rate is within the Amazon SQS limits for sending messages. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-quotas.html#quotas-requests">Amazon SQS quotas</a> in the <i>Amazon SQS Developer Guide</i>.</p> </li> </ul>
        capo_sqs.errors.resource_not_found_exception.ResourceNotFoundException: <p>One or more specified resources don't exist.</p>
        capo_sqs.errors.unsupported_operation.UnsupportedOperation: <p>Error code 400. Unsupported operation.</p>
        capo_sqs.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_sqs.types.cancel_message_move_task_request.CancelMessageMoveTaskRequest]",
    ) -> AsyncOperationResponse[
        "capo_sqs.types.cancel_message_move_task_result.CancelMessageMoveTaskResult"
    ]:
        import capo_sqs._operations.amazon_sqs.cancel_message_move_task

        (
            output,
            http_response,
        ) = await capo_sqs._operations.amazon_sqs.cancel_message_move_task.async_cancel_message_move_task(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CancelMessageMoveTask")
    )
    input_: capo_sqs.types.cancel_message_move_task_request.CancelMessageMoveTaskRequest = {
        "task_handle": task_handle
    }

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output