use of com.microsoft.azure.storage.queue.MessageUpdateFields in project camel by apache.
the class QueueServiceProducer method updateMessage.
private void updateMessage(Exchange exchange) throws Exception {
CloudQueue client = QueueServiceUtil.createQueueClient(getConfiguration());
QueueServiceRequestOptions opts = QueueServiceUtil.getRequestOptions(exchange);
CloudQueueMessage message = getCloudQueueMessage(exchange);
LOG.trace("Updating the message in the queue [{}] from exchange [{}]...", getConfiguration().getQueueName(), exchange);
EnumSet<MessageUpdateFields> fields = null;
Object fieldsObject = exchange.getIn().getHeader(QueueServiceConstants.MESSAGE_UPDATE_FIELDS);
if (fieldsObject instanceof EnumSet) {
@SuppressWarnings("unchecked") EnumSet<MessageUpdateFields> theFields = (EnumSet<MessageUpdateFields>) fieldsObject;
fields = theFields;
} else if (fieldsObject instanceof MessageUpdateFields) {
fields = EnumSet.of((MessageUpdateFields) fieldsObject);
}
client.updateMessage(message, getConfiguration().getMessageVisibilityDelay(), fields, opts.getRequestOpts(), opts.getOpContext());
}
Aggregations