Never mind, I realized my case only applied to data coming in in series.
In case anyone runs into a similar problem here is a possible solution:

1) implement custom class:
public class MySpecialRepository implements AggregationRepository, Predicate

2) use an instance of this class in your route as both aggregationRepository
and completionPredicate:
from("direct:input").aggregate(myCorrelationPredicate,
myAggregationStrategy)
.aggregationRepository(mySpecialRepository) // here
.completionPredicate(mySpecialRepository) // and here

3) in repository's remove method add delayed read logic:

//instance variable currentKey
public void remove(CamelContext context, String key, Exchange exchange)
 if(key <> currentKey)
  return previousExchange
unless
 exchange header contains end of file (in which case return current
exchange)

Thanks,

Mark


--
View this message in context: 
http://camel.465427.n5.nabble.com/problems-with-Camel-aggregation-pattern-tp4669621p4669869.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to