以下代码未将示例MY_TEST_FILE.csv上载到Azure存储blob。无法找出问题或找到执行此操作的任何示例。代码中缺少任何内容吗?日志文件中没有错误,在Azure存储中未找到该文件
'''
StorageSharedKeyCredential credential = new StorageSharedKeyCredential("test", "test");
String uri = "https://test.blob.core.windows.net";
BlobServiceClient client = new BlobServiceClientBuilder()
.endpoint(uri)
.credential(credential)
.buildClient();
CamelContext mycontext = new DefaultCamelContext();
mycontext.getRegistry().bind("client", client);
mycontext.setStreamCaching(true);
mycontext.addRoutes(new RouteBuilder() {
@Override
public void configure() {
from("file:c://folder2?fileName=MY_TEST_FILE.csv&noop=true").to("azure-storage-blob://test/report?blobName=MY_TEST_FILE.csv&operation=uploadBlockBlob&serviceClient=#client");
}
});
mycontext.start();'''
1条答案
按热度按时间daupos2t1#
您可能需要为azure-storage-blob组件提供凭据。
请注意,
#beanId
已过时,您可能必须根据camel版本切换到#bean:beanId
。