Я устанавливаю apache-camel в приложении весенней загрузки.И это отлично работает для файла и FTP-потребителя / производителя.Но при попытке использовать компонент Azure-blob в качестве потребителя появляется следующая ошибка:
com.microsoft.azure.storage.StorageException: серверу не удалось аутентифицировать запрос.Убедитесь, что значение заголовка авторизации сформировано правильно, включая подпись.
Мой маршрутизатор:
@Component
public class AzureFileImporter extends RouteBuilder {
@Bean
protected StorageCredentials azureAuth() {
return new StorageCredentialsAccountAndKey(
"AccountName",
"PlainAccountKey");
}
@Override
public void configure() throws Exception {
from("azure-blob:AccountName/ContainerName/blockBlob?
credentials=#azureAuth")
.routeId("azureFileImporter")
.noAutoStartup()
.log("Downloading file ${header.CamelFileName} complete.")
.to("file://input/ftp")
.end();
}
}
При использовании компонента BLOB-объекта Azure с таким жеаккаунт как производитель не выдается никакой ошибки.Но блоб не загружается в хранилище.Также пробовал с Base64
кодировкой ключа.
Используемые версии:
apache-camel : 2.22.1
springBootVersion = '2.0.5.RELEASE'
Это полный стек ошибок
2018-12-26 10:29:05.128 WARN 39352 --- [i/pim/blockBlob]
o.a.c.c.azure.blob.BlobServiceConsumer : Consumer Consumer[azure-blob://account1/container1/blockBlob?credentials=%23azureAuth] failed polling endpoint: azure-blob://account1/container1/blockBlob?credentials=%23azureAuth. Will try again at next poll. Caused by: [com.microsoft.azure.storage.StorageException - Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.]
com.microsoft.azure.storage.StorageException: Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
at com.microsoft.azure.storage.StorageException.translateFromHttpStatus(StorageException.java:175) ~[azure-storage-5.5.0.jar:na]
at com.microsoft.azure.storage.StorageException.translateException(StorageException.java:94) ~[azure-storage-5.5.0.jar:na]
at com.microsoft.azure.storage.core.StorageRequest.materializeException(StorageRequest.java:315) ~[azure-storage-5.5.0.jar:na]
at com.microsoft.azure.storage.core.ExecutionEngine.executeWithRetry(ExecutionEngine.java:175) ~[azure-storage-5.5.0.jar:na]
at com.microsoft.azure.storage.blob.CloudBlob.downloadAttributes(CloudBlob.java:1239) ~[azure-storage-5.5.0.jar:na]
at com.microsoft.azure.storage.blob.BlobInputStream.<init>(BlobInputStream.java:155) ~[azure-storage-5.5.0.jar:na]
at com.microsoft.azure.storage.blob.CloudBlob.openInputStream(CloudBlob.java:2383) ~[azure-storage-5.5.0.jar:na]
at org.apache.camel.component.azure.blob.BlobServiceUtil.doGetBlob(BlobServiceUtil.java:97) ~[camel-azure-2.22.1.jar:2.22.1]
at org.apache.camel.component.azure.blob.BlobServiceUtil.getBlockBlob(BlobServiceUtil.java:67) ~[camel-azure-2.22.1.jar:2.22.1]
at org.apache.camel.component.azure.blob.BlobServiceUtil.getBlob(BlobServiceUtil.java:51) ~[camel-azure-2.22.1.jar:2.22.1]
at org.apache.camel.component.azure.blob.BlobServiceConsumer.getBlob(BlobServiceConsumer.java:57) ~[camel-azure-2.22.1.jar:2.22.1]
at org.apache.camel.component.azure.blob.BlobServiceConsumer.poll(BlobServiceConsumer.java:44) ~[camel-azure-2.22.1.jar:2.22.1]
at org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:174) [camel-core-2.22.1.jar:2.22.1]
at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:101) [camel-core-2.22.1.jar:2.22.1]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_192]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [na:1.8.0_192]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_192]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [na:1.8.0_192]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_192]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_192]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_192]