在聚合之后,我尝试拆分一个是一组交换的交换。但是在拆分中,组的元素是空的。
我使用的是apache camel 2.17 (camel-core、camel-ftp和camel-scala)
from("sftp://user@host/path?password=pass")
.setHeader("tag", extractTagFromFilename)
.aggregate(header("tag"), new GroupedExchangeAggregationStrategy())
.completionSize(3) // i want 3 files per group
.split(_.in)
.process{m => println("== > " + m.in[])}
.end()
//.process{m => println("")} // btw this does not compile, why ?
.log("${body}")== > null
== > null
== > null
为什么组中的元素为空?
发布于 2016-05-16 21:57:51
要解决此问题,aggreg策略必须是GroupedMessageAggregationStrategy而不是GroupedExchangeAggregationStrategy。
文档不是最新的,这真的很痛苦,值得一提的是,".groupExchanges()“被弃用了,应该使用GroupedMessageAggregationStrategy来获得一个简单的基于列表的聚合。
https://stackoverflow.com/questions/37250181
复制相似问题