对骆驼聚集分割的最后一个索引执行操作

问题描述 投票:0回答:1

意图是在达到聚合的最后一个索引后,从EDI850Processor中清除类级别的属性。但是,当我们到达split的最后一个索引时,没有可用于精确查找的属性。

.split().jsonpath("$['ALL']").streaming().aggregate(AggregationStrategies.groupedExchange())               
    .constant("true")
    .completionSize(20)
    .completionTimeout(500)
    .bean(EDI850Processor.class, "process(*)")
    .marshal("edi850").id("marshal-edi850")
    // Do some final action if its last index of the split 
    .choice() 
    .when(simple("${property.CamelSplitComplete} == 'true'")) 
    .bean(EDI850Processor.class, "clear(*)")

可交换的属性:

{CamelGroupedExchange=List<Exchange>(30 elements),
 CamelAggregatedCompletedBy=size, 
 CamelMessageHistory=[DefaultMessageHistory[routeId=handle-EDI-processing, node=setHeader9], DefaultMessageHistory[routeId=handle-EDI-processing, node=bean5]], 
 CamelExternalRedelivered=false,
 CamelAggregatedCorrelationKey=true, 
 CamelAggregatedSize=30, 
 CamelCreatedTimestamp=Tue Nov 05 20:45:03 IST 2019}

哪个属性可以识别最后一个索引?

apache-camel dsl
1个回答
0
投票

您可以在拆分后立即将EDI850Processor bean放入步骤中。然后,在完成所有拆分/聚合处理之后将调用它。

© www.soinside.com 2019 - 2024. All rights reserved.