Eric
Eric

Reputation: 21

Apache Camel aggregator in combination with onCompletion

I want the onCompletion to occur after all the aggregated exchanges triggered by both completion size followed by timeout are processed. But it occurs right after the completion size is triggered with some of the exchanges waiting to be triggered by the timeout criteria.

Upvotes: 0

Views: 623

Answers (1)

Eric
Eric

Reputation: 21

I have the route configured as

from(fromEndPoint) .onCompletion() .doSomething() .split() // each Line .streaming() .parallelProcessing() .unmarshal().bindy .aggregate() .completionSize(100) .completionTimeout(5000) .to(toEndpoint)

Assume if the split was done on 405 lines, the first 4 sets of aggregated exchanges go to the to endpoint completing 400 lines(exchanges) . And then, it immediately triggers the onCompletion. But there are still 5 more aggregated exchanges which would be triggered when the completionTimeout criteria is met. It didn't trigger the onCompletion after the 5 exchanges are routed to the to endpoint.

My question here is , either the onCompletion should be triggered for each exchange or once after all.

Note:- My from endpoint here is a File.

Upvotes: 1

Related Questions