There are more AWS SDK examples available in the AWS Doc SDK Examples
Use PurgeQueue
with a CLI
The following code examples show how to use PurgeQueue
.
- CLI
-
- AWS CLI
-
To purge a queue
This example deletes all messages in the specified queue.
Command:
aws sqs purge-queue --queue-url
https://sqs.us-east-1.amazonaws.com/80398EXAMPLE/MyNewQueue
Output:
None.
-
For API details, see PurgeQueue
in AWS CLI Command Reference.
-
- PowerShell
-
- Tools for PowerShell
-
Example 1: This example deletes all messages from the specified queue.
Clear-SQSQueue -QueueUrl https://sqs.us-east-1.amazonaws.com/80398EXAMPLE/MyQueue
-
For API details, see PurgeQueue in AWS Tools for PowerShell Cmdlet Reference.
-
ListQueues
ReceiveMessage