Skip to content

start_message_move_task

start_message_move_task(
    source_arn: String,
    *,
    config_overrides: Optional[SQSClientConfig] = None,
    destination_arn: Optional[String] = None,
    max_number_of_messages_per_second: Optional[NullableInteger] = None,
) -> StartMessageMoveTaskResult

Starts an asynchronous task to move messages from a specified source queue to a specified destination queue.

  • This action is currently limited to supporting message redrive from queues that are configured as dead-letter queues (DLQs) of other Amazon SQS queues only. Non-SQS queue sources of dead-letter queues, such as Lambda or Amazon SNS topics, are currently not supported.

  • In dead-letter queues redrive context, the StartMessageMoveTask the source queue is the 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:

  • source_arn (String) –

    The ARN of the queue that contains the messages to be moved to another queue. Currently, only ARNs of dead-letter queues (DLQs) whose sources are other Amazon SQS queues are accepted. DLQs whose sources are non-SQS queues, such as Lambda or Amazon SNS topics, are not currently supported.

  • destination_arn (Optional[String], default: None ) –

    The ARN of the queue that receives the moved messages. You can use this field to specify the destination queue where you would like to redrive messages. If this field is left blank, the messages will be redriven back to their respective original source queues.

  • max_number_of_messages_per_second (Optional[NullableInteger], default: None ) –

    The number of messages to be moved per second (the message movement rate). You can use this field to define a fixed message movement rate. The maximum value for messages per second is 500. If this field is left blank, the system will optimize the rate based on the queue message backlog size, which may vary throughout the duration of the 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/sqs.py
def start_message_move_task(
    self,
    source_arn: "capo_sqs.types.string.String",
    *,
    config_overrides: Optional[SQSClientConfig] = None,
    destination_arn: Optional["capo_sqs.types.string.String"] = None,
    max_number_of_messages_per_second: Optional[
        "capo_sqs.types.nullable_integer.NullableInteger"
    ] = None,
) -> "capo_sqs.types.start_message_move_task_result.StartMessageMoveTaskResult":
    """<p>Starts an asynchronous task to move messages from a specified source queue to a specified destination queue.</p> <note> <ul> <li> <p>This action is currently limited to supporting message redrive from queues that are configured as <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html">dead-letter queues (DLQs)</a> of other Amazon SQS queues only. Non-SQS queue sources of dead-letter queues, such as Lambda or Amazon SNS topics, are currently not supported.</p> </li> <li> <p>In dead-letter queues redrive context, the <code>StartMessageMoveTask</code> the source queue is the 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:
        source_arn: <p>The ARN of the queue that contains the messages to be moved to another queue. Currently, only ARNs of dead-letter queues (DLQs) whose sources are other Amazon SQS queues are accepted. DLQs whose sources are non-SQS queues, such as Lambda or Amazon SNS topics, are not currently supported.</p>
        destination_arn: <p>The ARN of the queue that receives the moved messages. You can use this field to specify the destination queue where you would like to redrive messages. If this field is left blank, the messages will be redriven back to their respective original source queues.</p>
        max_number_of_messages_per_second: <p>The number of messages to be moved per second (the message movement rate). You can use this field to define a fixed message movement rate. The maximum value for messages per second is 500. If this field is left blank, the system will optimize the rate based on the queue message backlog size, which may vary throughout the duration of the 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.
    """

    def _handler(
        req: "OperationRequest[capo_sqs.types.start_message_move_task_request.StartMessageMoveTaskRequest]",
    ) -> OperationResponse[
        "capo_sqs.types.start_message_move_task_result.StartMessageMoveTaskResult"
    ]:
        import capo_sqs._operations.amazon_sqs.start_message_move_task

        output, http_response = (
            capo_sqs._operations.amazon_sqs.start_message_move_task.start_message_move_task(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StartMessageMoveTask")
    )
    input_: capo_sqs.types.start_message_move_task_request.StartMessageMoveTaskRequest = {
        "source_arn": source_arn
    }
    if destination_arn is not None:
        input_["destination_arn"] = destination_arn
    if max_number_of_messages_per_second is not None:
        input_["max_number_of_messages_per_second"] = (
            max_number_of_messages_per_second
        )

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output