use of com.microsoft.azure.storage.queue.CloudQueue in project azure-tools-for-java by Microsoft.
the class StorageClientSDKManager method createQueueMessage.
public void createQueueMessage(@NotNull StorageAccount storageAccount, @NotNull QueueMessage queueMessage, int timeToLiveInSeconds) throws AzureCmdException {
try {
CloudQueueClient client = getCloudQueueClient(storageAccount);
CloudQueue cloudQueue = client.getQueueReference(queueMessage.getQueueName());
cloudQueue.addMessage(new CloudQueueMessage(queueMessage.getContent()), timeToLiveInSeconds, 0, null, null);
} catch (Throwable t) {
throw new AzureCmdException("Error creating the Queue Message", t);
}
}
use of com.microsoft.azure.storage.queue.CloudQueue in project azure-tools-for-java by Microsoft.
the class StorageClientSDKManager method deleteQueue.
public void deleteQueue(@NotNull StorageAccount storageAccount, @NotNull Queue queue) throws AzureCmdException {
try {
CloudQueueClient client = getCloudQueueClient(storageAccount);
CloudQueue cloudQueue = client.getQueueReference(queue.getName());
cloudQueue.deleteIfExists();
} catch (Throwable t) {
throw new AzureCmdException("Error deleting the Queue", t);
}
}
Aggregations