// START SNIPPET: e1
// create the aggregation collection we will use.
// - we will correlate the received message based on the id header
// - as we will just keep the latest message we use the latest strategy
// - and finally we stop aggregate if we receive 2 or more messages
AggregationCollection ag = new PredicateAggregationCollection(header("id"),
new UseLatestAggregationStrategy(),
property(Exchange.AGGREGATED_SIZE).isEqualTo(3));
// our route is aggregating from the direct queue and sending the response to the mock
from("direct:start")