use of software.amazon.awssdk.services.sqs.model.UntagQueueRequest in project aws-doc-sdk-examples by awsdocs.
the class RemoveQueueTag method removeTag.
// snippet-start:[sqs.java2.remove_tag.main]
public static void removeTag(SqsClient sqsClient, String queueName, String tagName) {
try {
GetQueueUrlRequest urlRequest = GetQueueUrlRequest.builder().queueName(queueName).build();
GetQueueUrlResponse getQueueUrlResponse = sqsClient.getQueueUrl(urlRequest);
String queueUrl = getQueueUrlResponse.queueUrl();
UntagQueueRequest untagQueueRequest = UntagQueueRequest.builder().queueUrl(queueUrl).tagKeys(tagName).build();
sqsClient.untagQueue(untagQueueRequest);
System.out.println("The " + tagName + " tag was removed from " + queueName);
} catch (SqsException e) {
System.err.println(e.awsErrorDetails().errorMessage());
System.exit(1);
}
}
Aggregations