Search in sources :

Example 1 with PurgeQueueRequest

use of software.amazon.awssdk.services.sqs.model.PurgeQueueRequest in project aws-doc-sdk-examples by awsdocs.

the class SendReceiveMessages method purgeMyQueue.

public void purgeMyQueue() {
    SqsClient sqsClient = getClient();
    GetQueueUrlRequest getQueueRequest = GetQueueUrlRequest.builder().queueName(QUEUE_NAME).build();
    PurgeQueueRequest queueRequest = PurgeQueueRequest.builder().queueUrl(sqsClient.getQueueUrl(getQueueRequest).queueUrl()).build();
    sqsClient.purgeQueue(queueRequest);
}
Also used : PurgeQueueRequest(software.amazon.awssdk.services.sqs.model.PurgeQueueRequest) SqsClient(software.amazon.awssdk.services.sqs.SqsClient)

Aggregations

SqsClient (software.amazon.awssdk.services.sqs.SqsClient)1 PurgeQueueRequest (software.amazon.awssdk.services.sqs.model.PurgeQueueRequest)1