Question about the combination of completionSize and completionTimeout.

Solution Unverified - Updated -

Issue

  • I have the following route
from("direct:start")
            .process(exchange -> {
                Message exchangeIn = exchange.getIn();
                exchangeIn.setHeader("_processID", UUID.randomUUID());
                exchangeIn.setHeader("_datCount", 4);
            })
            .split(body())
            .bean(myService, "doSomeThing")
            .aggregate(header("_processID"), new GroupedExchangeAggregationStrategy())
            .completionSize(header("_datCount"))
            .completionTimeout(20000)
            .process(exchange -> filterService.filter(BNYM));
  • The reason I am using both completionSize and completionTimeout is something to do with the following scenario.
    • Say the split comes out with 100 threads and 2 of them failed during the myService.doSomeThing, I am assuming aggregate option completionSize set to 100 will never complete the aggregation. That is why I add completionTimeout to force the end of aggregation.
    • However, it looks like it will always wait 20 seconds even though all 100 threads are done correctly without any issue.
  • Was there anything I did wrong?

Environment

  • Red Hat JBoss Fuse
    • 6.3.0

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.