简体   繁体   English

Apache Camel Batch处理后如何移动文件?

[英]How can I move file after Apache Camel Batch processing?

I bring a file from Amazon S3 and process it with Spring Batch, all integrated with Apache Camel. 我从Amazon S3带来一个文件,并使用Spring Batch处理该文件,所有文件均与Apache Camel集成。

After the batch, message body is not the file content anymore, it's de Job. 批处理之后,消息正文不再是文件内容,而是工作。 But I want to move the file to another s3 bucket. 但是我想将文件移到另一个s3存储桶。 How can I get the File content back? 如何找回文件内容? (I do have the headers) (我确实有标题)

(Using S3 is circumstantial) (视情况使用S3)

        from("aws-s3://my-bucket...")
            .idempotentConsumer(header("CamelAwsS3Key"),
                  MemoryIdempotentRepository.memoryIdempotentRepository(200))
            .setHeader("CamelFileName", simple("${in.header.CamelAwsS3Key}"))
            .to("file:my-files/")
            .log("Copied from S3.")
            .to("spring-batch:historicoJob")
            .choice()
            .when(simple("${in.body.status} == 'COMPLETED'"))
            .to("direct:moveIt")
            .endChoice();

    from("direct:moveIt")
             ...
            .to("aws-s3://done-bucket...");

您可以访问原始消息(骆驼交换中有一些api->工作单元),也可以在春季批处理之前将消息主体复制到交换属性,然后再将其还原。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误后如何使用doCatch在Apache Camel中移动文件 - How to move a file after error in Apache Camel using doCatch Apache Camel:文件传输后获取移动路径 - Apache Camel: Get move path after file transfer 如何在Apache Camel中循环 - How can I loop in Apache Camel Apache Camel:带重音字符的文件处理 - Apache Camel: file processing with accented characters 在 spring 批处理中,我们如何将处理后的文件移动到另一个文件夹,我正在使用 MultiResourceItemReader 和块处理 - In spring batch how can we move the processed files to another folder, I am using MultiResourceItemReader and chunk processing 如何使用Apache Camel读取文件,如何使用Spring批处理文件,读取每一行并将其路由回Apache Camel - How to read file using Apache Camel, process the file using Spring batch, read each line and route it back through Apache Camel Apache Camel多线程处理 - Apache Camel multithread processing 如果在路由完成后无法移动文件,则让 Apache Camel 停止重试 - Getting Apache Camel to stop retrying if failed to move the file after route completion 如何使用Apache Camel,java DSL,eclipse更改XML文件的内容 - How can I change the content of XML file with Apache Camel, java DSL, eclipse 如何拆分包含Apache骆驼中文件列表的交换并将每个文件写入文件系统中 - How can I split an exchange that contains a list of files in apache camel and write each file on the filesystem
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM