camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: Mixing ChoiceDefinition with DelayDefinition
Date Fri, 21 Jun 2013 11:37:38 GMT

Use a new route for the aggregate, and then use "direct:xxx" endpoint
from the choice to call that route.

On Fri, Jun 21, 2013 at 12:59 PM, cristisor <> wrote:
> Hello,
> I have the following route:
> from(startEndpoint)
> .choice()
> .when(fileIsComplete()).delay(COMPLETION_TIMEOUT).process(processor).to(outputEndpoint)
> .otherwise().aggregate(new ObjectsAggregator()).constant(true)
> .completionSize(BATCH_SIZE).completionTimeout(COMPLETION_TIMEOUT)
> .process(processor).stop();
> So, if the fileIsComplete is true, process only one exchange and send the
> response to another endpoint otherwise aggregate up to a number of
> BATCH_SIZE, process in the end, and stop the routing.
> Because my Camel version is pretty old (2.4.0-fuse-00-00) I don't have
> "endChoice", so if I insert the delay or the aggregator I can't access the
> "otherwise" branch. I really need both of them so I thought to insert
> another processor, before the actual processing, that puts the current
> thread to sleep for COMPLETION_TIMEOUT and leave the aggregation to the
> other branch, since I won't have to continue using the ChoiceDefinition.
> Is there a better way to solve this problem without upgrading the Camel
> version?
> Thanks.
> --
> View this message in context:
> Sent from the Camel - Users mailing list archive at

Claus Ibsen
----------------- The open source integration conference.

Red Hat, Inc.
FuseSource is now part of Red Hat
Twitter: davsclaus
Author of Camel in Action:

View raw message