You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by oceansize <oc...@tut.by> on 2017/05/16 15:21:31 UTC

Apache Camel aggregator with parallelProcessing completion callback

I'm using Apache Camel aggregator with parallelProcessing to process
aggregated exchanges concurrently:

from("direct:test")               
            .aggregate(constant(true), new
GroupedMessageAggregationStrategy())
            .completionSize(10)
            .completionTimeout(3000)
            .parallelProcessing()
            .to("direct:test2")
            .log("Completed!") //executed for each aggregated exchange  
            .end();

What I need is to get a callback when all aggregated exchanges are processed
and log "Completed!" after that.

Currently, (see the log statement above) - it's getting executed for each
aggregated exchange.

I found that the *AggregateProcessor->public int
getInProgressCompleteExchanges()* would help me (i.e. it's set to 0 when all
aggregated exhanges are processed). But since an instance of
AggregateProcessor is created dynamically - don't have any idea how to call
this method.

Thanks in advance for any suggestion.



--
View this message in context: http://camel.465427.n5.nabble.com/Apache-Camel-aggregator-with-parallelProcessing-completion-callback-tp5799641.html
Sent from the Camel - Users mailing list archive at Nabble.com.