Apache camel 这台机器不能正常工作
使用xslt转换文件后,我必须附加从ftp下载的文件。因此,我做了以下工作:Apache camel 这台机器不能正常工作,apache-camel,Apache Camel,使用xslt转换文件后,我必须附加从ftp下载的文件。因此,我做了以下工作: from("direct:adobe_productList_incremental") .id("routeADOBESPtransformPI_productList") .log(LoggingLevel.INFO, "---------Starting file: ${body}") .convertBodyTo(InputStre
from("direct:adobe_productList_incremental")
.id("routeADOBESPtransformPI_productList")
.log(LoggingLevel.INFO, "---------Starting file: ${body}")
.convertBodyTo(InputStream.class)
.to("xslt:classpath:" + xsltTransformationProductList)
.log(LoggingLevel.INFO, "---------Transformed file: ${body}")
.pollEnrich(ftpType+"://"+ftpUsername+"@"+ ftpUrl +":" + ftpPort + ftpPath_incrementalComplete +"?password="+ftpPassword+"&fileName="+ftpFilename_incrementalComplete+"&passiveMode=true&binary=true&delete=false",10000)
.log(LoggingLevel.INFO, "---------After poll enrich: ${body}")
.to("file:{{file.root}}{{file.outbox.products_list_incremental}}?fileName={{file.outbox.products_list_incremental.name}}.final");
直到轮询everythin正常工作(转换正确完成),但在轮询完成后,当前正文将被ftp内容覆盖(而不是像应该的那样附加)
有什么帮助吗?没有,它按设计工作 默认情况下,内容将被覆盖。如果需要追加/合并或其他什么,则需要使用自定义聚合策略,并实现执行此操作的代码逻辑 参见骆驼文档:关于示例聚合策略 骆驼医生说 聚合策略是可选的。如果你不提供 默认情况下,Camel将只使用从资源获得的主体
感谢克劳斯,我使用了ExampleAgregationStrategy,但是在resource.getOut().getBody()中使用了它;我得到一个空值,我尝试执行以下资源;但在这种情况下,我得到null。所以我无法从ftp检索尸体。。。我的投票现在是。pollEnrich(ftpType+):/“+ftpUsername+”@“+ftpUrl+”:“+ftpPort+ftpPath\u incrementalComplete+”?password=“+ftpPassword+”&fileName=“+ftpFilename\u incrementalComplete+”&passiveMode=true&binary=true&delete=true”,10000,new AggregationStrategy(){…使用getIn-请参阅此常见问题解答:如果正文为空,则在超时等待10秒时可能没有文件。