Java Apache Camel批处理后如何移动文件?
我从AmazonS3带来了一个文件,并使用SpringBatch处理它,所有这些都与ApacheCamel集成 批处理之后,消息体不再是文件内容,而是解除作业。但我想把文件移到另一个s3存储桶。如何取回文件内容?(我有标题) (使用S3是间接的)Java Apache Camel批处理后如何移动文件?,java,amazon-s3,spring-boot,apache-camel,spring-batch,Java,Amazon S3,Spring Boot,Apache Camel,Spring Batch,我从AmazonS3带来了一个文件,并使用SpringBatch处理它,所有这些都与ApacheCamel集成 批处理之后,消息体不再是文件内容,而是解除作业。但我想把文件移到另一个s3存储桶。如何取回文件内容?(我有标题) (使用S3是间接的) 您可以访问原始消息(在camel exchange->unit of work上有一些api),或者您可以在spring批处理之前将消息体复制到一个exchange属性,然后再将其恢复 from("aws-s3://my-bucket.
您可以访问原始消息(在camel exchange->unit of work上有一些api),或者您可以在spring批处理之前将消息体复制到一个exchange属性,然后再将其恢复
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...");