List of usage examples for com.amazonaws.services.sqs.model DeleteQueueRequest setQueueUrl
public void setQueueUrl(String queueUrl)
The URL of the Amazon SQS queue to delete.
From source file:com.eucalyptus.portal.SimpleQueueClientManager.java
License:Open Source License
public void deleteQueue(final String queueName) throws Exception { try {//from ww w .ja va 2 s . c o 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 {/* ww w . j a va 2s . c o 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; }