Apache camel 在apache camel中处理大型压缩文件

Apache camel 在apache camel中处理大型压缩文件,apache-camel,Apache Camel,我试图从ftp服务器获取一个压缩为.zip的文件,并尝试使用camel将其存储在S3中,压缩为.gzip。 以下是我目前的路线 from("sftp://username@host/file_path/?password=<password>&noop=true&streamDownload=true") .routeId("route_id") .setExchangePattern(ExchangePattern.InOut) .unmar

我试图从ftp服务器获取一个压缩为.zip的文件,并尝试使用camel将其存储在S3中,压缩为.gzip。 以下是我目前的路线

from("sftp://username@host/file_path/?password=<password>&noop=true&streamDownload=true")
    .routeId("route_id")
    .setExchangePattern(ExchangePattern.InOut)
    .unmarshal().zipFile()
    .marshal().gzip()
    .to("aws-s3://s3_bucket_name?amazonS3Client=#client");
from(“sftp://username@主机/文件(路径/?密码=&noop=true&streamDownload=true))
.routeId(“路线id”)
.setExchangePattern(ExchangePattern.InOut)
.unmarshal().zipFile()
.marshal().gzip()
.to(“aws-s3://s3_bucket_name?amazonS3Client=#client”);
这适用于较小的文件。但我有压缩时大小约为700MB的文件。对于这种大小的文件,我得到
OutOfMemoryError For Java堆空间

我知道camel(
.split(body().tokenize(“\n”)).streaming()
)中有一个流式处理选项,但我不确定是否可以在流式处理时执行umarshal和封送处理。(我看到了类似的解决方案,但在本例中,源文件是纯文本/csv)。
问题的第二部分是将文件流式传输回S3。我知道组件中有多端口加载选项,但它似乎要求源文件是一个文件。我不知道如何做到这一点

不使用自定义处理器中的java代码处理(解压缩然后gzip)文件,可以实现这一点吗

环境:Camel2.19.3,Java8


谢谢

我用
streamCaching()
解决了这个问题。所以我要做的就是

from('xyz')
.streamCaching()
.unmarshall().gzip()
.to('abc')
.end()

这个问题解决了吗?我也有类似的问题。