[英]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.