Hi

You may take a look at the recipient list, routing slip, or dynamic
router EIP patterns in Camel. They are more dynamic than the content
based router.

You would then be able from a piece of Java code, to return a String
that contains the uri of the exec command.



On Wed, Aug 22, 2012 at 6:13 AM, wagner <[email protected]> wrote:
> Hi, thanks for remarks.
>
> Jean, I have been used camel-exec feature based on one of your posts:
> *http://blog.nanthrax.net/2011/08/use-camel-cxf-and-karaf-to-implement-batches/*
>
> So, I change route.xml properly, like below:
>   <camelContext xmlns="http://camel.apache.org/schema/spring";>
>     <route id="control">
>         <from uri="cxfrs:bean:rsServer"/>
>         <to uri="controllerBean"/>
>     </route>
>     <route autoStartup="false" id="batch">
>         <from uri="controllerBean"/>
>         <to
> uri="exec:/run/media/wagner/fzlbpms_env/PROGSATIVOS/fzlbpms/bin/fzl_open_gi.sh"/>
>         <process ref="stopProcessor"/>
>     </route>
>
> and works really great.
>
>
>
> But, my problem is that, in this way, I can execute just only one command
> (the fzl_open_gi.sh one), from http://localhost:9090/batch/start/ request.
>
>
> My wishes is to run commands based on a content-routed pattern like below:
>
>     <route autoStartup="false" id="batch">
>         <from uri="controllerBean"/>
>         <choice>
>             <when>
>                 <xpath>$body = 'bar_command'</xpath>
>                 <to uri="exec:/run/media/.../fzlbpms/bin/bar_command.sh"/>
>             </when>
>             <when>
>                 <xpath>$body = 'cheese_command'</xpath>
>                 <to
> uri="exec:/run/media/.../fzlbpms/bin/cheese_command.sh"/>
>             </when>
>             <otherwise>
>                 <to
> uri="exec:/run/media/.../fzlbpms/bin/default_command.sh"/>
>             </otherwise>
>         </choice>
>
>         <process ref="stopProcessor"/>
>     </route>
>
>
>     To achieve this, I think that the body message (produced by
> controllerBean handler method) should be produce the diferents commanda
> namea and not only the "batch" string.
>
>    Maybe my final question is: How to instruct controllerBean to produce a
> selective body message based on a diferent rest path like
>
> http://localhost:9090/batch/start/bar_command
> http://localhost:9090/batch/start/cheese_command
>
> Could you help me please?
>
> PS: If a failed to explain myself, please let me know.
>
> Best Regards
>
>
>
> --
> View this message in context: 
> http://servicemix.396122.n5.nabble.com/how-to-intall-servicemix-exec-in-apache-servicemix-4-4-1-fuse-07-11-tp5714116p5714217.html
> Sent from the ServiceMix - User 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