camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "richie.riviere@gmail.com" <richie.rivi...@gmail.com>
Subject Ideas on how to structure route (alternatives to direct:...)
Date Fri, 13 Dec 2013 21:46:51 GMT
Hi All,

I've got two main routes in my application. An import route and an export
route.

At the end of my import route i say... .to("direct:import");

Then at the start of my export i say ... .from("direct:import")

Pretty standard stuff.

Yesterday I had to change my application to run about 5 post processing
routes that execute sql queries to run after the import and before the
export. I did this using the sql component. This worked fine. But i had to
link them all up using the direct component.

i.e.
to(direct)>from(direct),(direct)>from(direct),(direct)>from(direct),(direct)>from(direct)
etc

It's starting to get ugly now....

Can anyone give me some ideas on how to structure my routes to make it a bit
nicer. Really there are three parts to my application now..

An import route, some post processing and an export route. Is there a way
that I can have some sort of container route for all my post processing
routes? They can't all run parallel because some of the sql queries are
dependent on each other.

My original thought was just to have one routeBuilder with many from and to
definitions...

from("direct:import").to("sql:query1")

from("direct:import").to("sql:query2")

from("direct:import").to("sql:query3")

But I found out yesterday you can't do this. I get a camel error saying
multiple routes are linked to "direct:import".

thanks for your help





--
View this message in context: http://camel.465427.n5.nabble.com/Ideas-on-how-to-structure-route-alternatives-to-direct-tp5744748.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message