Hi Laurent,

A camel route uses by default the pipeline processor when you use the
syntax from().to().to(). As you are using the direct component, camel will
link the different processors when it will start the camel route within the
same thread.

So you can create a route like this

<route>
   <from uri="..." />
   <to uri="direct:route1" />
   <to uri="direct:route2" />
</route>

<route>
   <to uri="direct:route1" />
   <to uri="bean:aBean" />
</route>

<route>
   <to uri="direct:route2" />
   <to uri="bean:aSecondBean" />
</route>

OR

<route>
   <to uri="direct:route1" />
   <to uri="bean:aBean" />
   <to uri="bean:aSecondBean" />
</route>

This is up to you to decide depending if you would like to separate the
business logic and keep the different direct routes appart or simply
improve the readability of the camel DSL

Regards,

Charles Moulliard
Apache Committer / Sr. Enterprise Architect (RedHat)
Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com



On Wed, Oct 3, 2012 at 9:01 PM, lolo <laurent.gaert...@lchclearnet.com>wrote:

> What I try to figure out is how I can do the following using Java DSL:
>
> <route>
>    <from uri="..." />
>    <to uri="direct:route1" />
>    <to uri="direct:route2" />
> </route>
>
> How exactly should I create a parent route that calls route1 and route2 in
> sequential using java DSL?
> I've tried different ways but non of them worked for me.
> Should I use "pipeline()"  in the parent route?
>
> Will in that case route1 commit the transaction before Camel invokes
> route2?
>
> Thanks for all your help!
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Two-routes-two-transactions-tp5720484p5720509.html
> Sent from the Camel Development mailing list archive at Nabble.com.
>

Reply via email to