Hi

Its better to ask on the @user mailing list about how to do X with Camel.

And yes its possible. The RouteBuilder is just java code, so whatever
you can do in java you can do there.
You can have if .. else .. for loops .. and whatnot.

What people often do in these cases is to build a base class extending
RouteBuilder as a "template" route.
And then maybe have getter/setter to configure it, and then logic in
configure to act accordingly.



On Sat, Jun 23, 2012 at 8:47 PM, Murari Raghavan
<[email protected]> wrote:
> Hello,
>
> Is it possible to build routes dynamically based on a configuration file?
>
> Here is my scenario.
> The route is from inbox->shared->PROCESSOR->outbox. I want this to be
> dynamic instead of defining it in the overridden Configure method in
> MyRouteBuilder class.
>
> Existing:
>
> from(routes.getString("inbound")).to(routes.getString("shared.inbound")).process(new
> Processor() {
>            public void process(Exchange exchange) throws Exception {
>                MYProcessor asdaProcessor = new myProcessor();
>                myProcessor.process(exchange);
>            }
>
> I want the RouteBuilder to be generic and to be able to handle a change in
> route to inbox->PROCESSOR->shared->outbox by reading a configuration file.
> Is this achievable?
>
> Appreciate your help.
>
> Thanks,
> Murari
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Is-it-possible-to-dynamically-build-routes-tp5714971.html
> Sent from the Camel Development mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
FuseSource
Email: [email protected]
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Reply via email to