List of usage examples for com.amazonaws.services.sqs.model DeleteQueueRequest DeleteQueueRequest
public DeleteQueueRequest()
From source file:awslabs.lab31.SolutionCode.java
License:Open Source License
@Override public void deleteQueue(AmazonSQSClient sqsClient, String queueUrl) { // TODO: Construct a DeleteQueueRequest object using the provided queue URL. DeleteQueueRequest deleteQueueRequest = new DeleteQueueRequest().withQueueUrl(queueUrl); // TODO: Submit the request using the deleteQueue method of the sqsClient object. sqsClient.deleteQueue(deleteQueueRequest); }
From source file:com.eucalyptus.portal.SimpleQueueClientManager.java
License:Open Source License
public void deleteQueue(final String queueName) throws Exception { try {/* w w w .j a v a 2s . co m*/ final DeleteQueueRequest req = new DeleteQueueRequest(); req.setQueueUrl(getQueueUrl(queueName)); getSimpleQueueClient().deleteQueue(req); } catch (final AmazonServiceException ex) { throw new Exception("Failed to delete queue due to service error", ex); } catch (final AmazonClientException ex) { throw new Exception("Failed to delete queue due to client error", ex); } }
From source file:org.apache.usergrid.apm.service.ApplicationServiceImpl.java
License:Apache License
boolean deleteSQSQueue(String appName) { log.info("Deleting Queue for App : " + appName.toString()); DeleteQueueRequest deleteQueueRequest = new DeleteQueueRequest(); deleteQueueRequest.setQueueUrl(AWSUtil.formFullQueueUrl(appName.toString())); try {/* w w w. j a v a2 s. co m*/ sqsClient.deleteQueue(deleteQueueRequest); return true; } catch (AmazonServiceException ase) { if (ase.getErrorCode().equals("AWS.SimpleQueueService.NonExistentQueue")) { log.info("Queue for app : " + appName.toString() + " was probably already deleted. " + ase.getMessage()); } else { log.error(ase); } } catch (AmazonClientException ace) { log.error(ace); } return false; }
From source file:org.apache.usergrid.persistence.queue.impl.SNSQueueManagerImpl.java
License:Apache License
@Override public void deleteQueue() { logger.warn("Deleting queue: " + getReadQueue().getUrl()); sqs.deleteQueue(new DeleteQueueRequest().withQueueUrl(getReadQueue().getUrl())); logger.warn("Deleting queue: " + getReadQueue().getUrl() + "_dead"); sqs.deleteQueue(new DeleteQueueRequest().withQueueUrl(getReadQueue().getUrl() + "_dead")); }