listMessageMoveTasks method

Future<ListMessageMoveTasksResult> listMessageMoveTasks({
  1. required String sourceArn,
  2. int? maxResults,
})

Gets the most recent message movement tasks (up to 10) under a specific source queue.

  • 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.

May throw InvalidAddress. May throw InvalidSecurity. May throw RequestThrottled. May throw ResourceNotFoundException. May throw UnsupportedOperation.

Parameter sourceArn : The ARN of the queue whose message movement tasks are to be listed.

Parameter maxResults : The maximum number of results to include in the response. The default is 1, which provides the most recent message movement task. The upper limit is 10.

Implementation

Future<ListMessageMoveTasksResult> listMessageMoveTasks({
  required String sourceArn,
  int? maxResults,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'AmazonSQS.ListMessageMoveTasks'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'SourceArn': sourceArn,
      if (maxResults != null) 'MaxResults': maxResults,
    },
  );

  return ListMessageMoveTasksResult.fromJson(jsonResponse.body);
}