camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Meissa Sakho <>
Subject Using the aggregator pattern
Date Tue, 20 Feb 2018 16:40:32 GMT
Hello everyone,

I'm trying to use the Aggregator Pattern with the 2 requirements below:

A large quantity of fixed loan data is sent to the application through the
file system.
The loans should be aggregated with a defined correlation id to batch of 20
When a laps of 10 seconds elapses, the aggregated files should be completed
even if the number of files is not equals to 20.

Below is a snipped of the route.

public void configure() throws Exception {
   .aggregate(header("company"), new LoansAggregationStrategy())
           * .completionSize(20)*
*            .completionTimeout(10000)*



I'm using the competionSize condition to control the number of messages and
it works fine.
I'm trying to combine it with the completionTimeout so that aggregated
messages are built if a number of 10 second is reached even if there are
not 20 messages to be aggregated.

The problem is with the second condition. When the route runs, I can see
from the output that the second condition is not met.
Do you have an advice on how to achieve this second condition?


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message