use of com.microsoft.azure.storage.queue.CloudQueue in project camel by apache.
the class QueueServiceProducer method deleteMessage.
private void deleteMessage(Exchange exchange) throws Exception {
LOG.trace("Deleting the message from the queue [{}] from exchange [{}]...", getConfiguration().getQueueName(), exchange);
CloudQueue client = QueueServiceUtil.createQueueClient(getConfiguration());
QueueServiceRequestOptions opts = QueueServiceUtil.getRequestOptions(exchange);
CloudQueueMessage message = getCloudQueueMessage(exchange);
client.deleteMessage(message, opts.getRequestOpts(), opts.getOpContext());
}
use of com.microsoft.azure.storage.queue.CloudQueue in project camel by apache.
the class QueueServiceProducer method deleteQueue.
private void deleteQueue(Exchange exchange) throws Exception {
LOG.trace("Deleting the queue [{}] from exchange [{}]...", getConfiguration().getQueueName(), exchange);
CloudQueue client = QueueServiceUtil.createQueueClient(getConfiguration());
QueueServiceRequestOptions opts = QueueServiceUtil.getRequestOptions(exchange);
client.delete(opts.getRequestOpts(), opts.getOpContext());
}
use of com.microsoft.azure.storage.queue.CloudQueue in project camel by apache.
the class QueueServiceUtil method retrieveMessage.
public static void retrieveMessage(Exchange exchange, QueueServiceConfiguration cfg) throws Exception {
CloudQueue client = createQueueClient(cfg);
QueueServiceRequestOptions opts = getRequestOptions(exchange);
CloudQueueMessage message = client.retrieveMessage(cfg.getMessageVisibilityDelay(), opts.getRequestOpts(), opts.getOpContext());
ExchangeUtil.getMessageForResponse(exchange).setBody(message);
}
use of com.microsoft.azure.storage.queue.CloudQueue in project camel by apache.
the class QueueServiceComponentConfigurationTest method testCreateEndpointWithMinConfigForClientOnly.
@Test
public void testCreateEndpointWithMinConfigForClientOnly() throws Exception {
CloudQueue client = new CloudQueue(URI.create("https://camelazure.queue.core.windows.net/testqueue/messages"), newAccountKeyCredentials());
JndiRegistry registry = (JndiRegistry) ((PropertyPlaceholderDelegateRegistry) context.getRegistry()).getRegistry();
registry.bind("azureQueueClient", client);
QueueServiceComponent component = new QueueServiceComponent(context);
QueueServiceEndpoint endpoint = (QueueServiceEndpoint) component.createEndpoint("azure-queue://camelazure/testqueue?azureQueueClient=#azureQueueClient");
doTestCreateEndpointWithMinConfig(endpoint, true);
}
use of com.microsoft.azure.storage.queue.CloudQueue in project camel by apache.
the class QueueServiceUtilTest method testGetConfiguredClient.
@Test
public void testGetConfiguredClient() throws Exception {
CloudQueue client = new CloudQueue(URI.create("https://camelazure.queue.core.windows.net/testqueue/messages"), newAccountKeyCredentials());
JndiRegistry registry = (JndiRegistry) ((PropertyPlaceholderDelegateRegistry) context.getRegistry()).getRegistry();
registry.bind("azureQueueClient", client);
QueueServiceComponent component = new QueueServiceComponent(context);
QueueServiceEndpoint endpoint = (QueueServiceEndpoint) component.createEndpoint("azure-queue://camelazure/testqueue?azureQueueClient=#azureQueueClient");
assertSame(client, QueueServiceUtil.getConfiguredClient(endpoint.getConfiguration()));
}
Aggregations