deleteQueue method

Future<void> deleteQueue({
  1. required String queueUrl,
})

Deletes the queue specified by the QueueUrl, regardless of the queue's contents. When you delete a queue, the deletion process takes up to 60 seconds. Requests you send involving that queue during the 60 seconds might succeed. For example, a SendMessage request might succeed, but after 60 seconds the queue and the message you sent no longer exist.

When you delete a queue, you must wait at least 60 seconds before creating a queue with the same name.

The delete operation uses the HTTP GET verb.

May throw InvalidAddress. May throw InvalidSecurity. May throw QueueDoesNotExist. May throw RequestThrottled. May throw UnsupportedOperation.

Parameter queueUrl : The URL of the Amazon SQS queue to delete.

Queue URLs and names are case-sensitive.

Implementation

Future<void> deleteQueue({
  required String queueUrl,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'AmazonSQS.DeleteQueue'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'QueueUrl': queueUrl,
    },
  );
}