【问题标题】:Logging filename during file transfer from aws s3 using apache camel在使用 apache camel 从 aws s3 传输文件期间记录文件名
【发布时间】:2018-07-04 16:06:33
【问题描述】:

我是 Apache camel-aws 的初学者。我正在编写一个程序来使用 apache camel 将文件从一个 aws s3 存储桶传输到另一个存储桶。我现在想记录从 s3 中选取的文件/对象名称。你能帮我做同样的事情吗?下面是我的代码sn-p。 ${file:name} 适用于 camel 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}");

亲切的问候, 卡西夫

【问题讨论】:

    标签: amazon-s3 apache-camel apache-camel-aws


    【解决方案1】:

    不,不一样。

    您需要使用标头 CamelAwsS3Key

    .log("The following file has been picked for file transfer: ${header.CamelAwsS3Key}")

    这是在使用 S3 存储桶时设置的。

    【讨论】:

    • 您好,您能否帮我提供一些链接,这些链接可以帮助我有效地学习和编写camel-aws 代码?我看过骆驼文档,但它缺乏这样的信息并且处于高水平。我正在寻找一份详细的文件。
    • 您可以查看camel repo github.com/apache/camel/tree/master/components/camel-aws/src/… 中的文档,在这里您可以找到基于当前代码2.21.0-SNAPSHOT 的所有asciidoc
    猜你喜欢
    • 2015-03-13
    • 1970-01-01
    • 2017-11-21
    • 2021-10-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-04-01
    • 2021-05-26
    相关资源
    最近更新 更多