[英]Logging filename during file transfer from aws s3 using apache camel
I am a beginner to Apache camel-aws. 我是Apache骆驼的初学者。 I am writing a program to transfer a file from one aws s3 bucket to another bucket using apache camel.
我正在编写一个程序,使用Apache骆驼将文件从一个AWS S3存储桶传输到另一个存储桶。 I now want to log the file/object name that is being picked from s3.
现在,我要记录从s3中选取的文件/对象名称。 Could you please help me with the same?
您能帮我吗? Below is my code snippet.
以下是我的代码段。 ${file:name} works for camel FTP component, want to understand its equivalent in aws.
$ {file:name}适用于骆驼FTP组件,想了解其等效于AWS的情况。
from("aws-s3://sourceBucket?amazonS3Client=#amazonS3Client")
.log("The following file has been picked for file transfer : ${file:name}")
.routeId("Test My Files").log("Building Destination URI for fie transfer")
.to("aws-s3://destinationBucket?amazonS3Client=#amazonS3Client")
.log("The following file transfer has completed : ${file:name}");
Kind regards, Kashif 亲切的问候,Kashif
No it's not the same. 不,不一样。
You need to use the header CamelAwsS3Key 您需要使用标题CamelAwsS3Key
.log("The following file has been picked for file transfer: ${header.CamelAwsS3Key}")
This is set while consuming from S3 Bucket. 从S3 Bucket消费时设置。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.