Намерено очистить атрибуты уровня класса от EDI850Processor, как только будет достигнут последний индекс агрегирования. Но нет свойства, которое можно было бы точно найти, когда мы достигли последнего индекса разделения.
.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}
Какое свойство может идентифицировать последний индекс