2016-05-16 43 views
-1

聚合后,我试图分裂交换是一组交易所。但在分组内部,该组的元素为空。聚合然后分裂与阿帕奇骆驼

我使用Apache的骆驼2.17(骆驼核心,骆驼ftp和骆驼斯卡拉)

from("sftp://[email protected]/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

为什么组中的元素为空?

+0

downvote是什么原因? – mfudi

回答

0

要解决此问题,聚合策略必须是GroupedMessageAggregationStrategy而不是GroupedExchangeAggregationStrategy。

文档不是最新的,应该提到“.groupExchanges()”已被弃用,应该使用GroupedMessageAggregationStrategy来获得简单的基于列表的聚合。