You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by xiangqiuzhao <xi...@gmail.com> on 2011/07/13 17:36:48 UTC

how to design which routes be start in my application?

if my application use route config like :

<routes>
    <route1 enable="yes">....</route1>
    <route2 enable="yes">....</route2>
    <route3 enable="no">....</route3>
</routes>

how to start the route1 and route2, i must control it by java coding?

--
View this message in context: http://camel.465427.n5.nabble.com/how-to-design-which-routes-be-start-in-my-application-tp4583090p4583090.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: how to design which routes be start in my application?

Posted by Willem Jiang <wi...@gmail.com>.
Camel has the API to start or stop the route with the routeId like this
camelContext.startRoute("route1");
camelContext.stopRoute("route2");

On 7/14/11 2:23 AM, boday wrote:
> you can use the autoStartup attribute along with properties to do this...like
> this
>
> <route id="foo" autoStartup="{{cool.foo.startup}}">
>
>
> xiangqiuzhao wrote:
>>
>> if my application use route config like :
>>
>> <routes>
>>      <route1 enable="yes">....</route1>
>>      <route2 enable="yes">....</route2>
>>      <route3 enable="no">....</route3>
>> </routes>
>>
>> how to start the route1 and route2, i must control it by java coding?
>>
>
>
> -----
> Ben O'Day
> IT Consultant -http://consulting-notes.com
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/how-to-design-which-routes-be-start-in-my-application-tp4583090p4583710.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


-- 
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
          http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Weibo: willemjiang

Re: how to design which routes be start in my application?

Posted by Claus Ibsen <cl...@gmail.com>.
On Wed, Jul 13, 2011 at 8:23 PM, boday <be...@initekconsulting.com> wrote:
> you can use the autoStartup attribute along with properties to do this...like
> this
>
> <route id="foo" autoStartup="{{cool.foo.startup}}">
>

When using property placeholders, you can read about it here
http://camel.apache.org/using-propertyplaceholder.html

As Willem wrote you can also use a boolean value
 <route id="foo" autoStartup="false">

The property placeholders allows you to externalize this into eg a
.properties file, so you can have in a .properties file:
cool.foo.startup=false




>
> xiangqiuzhao wrote:
>>
>> if my application use route config like :
>>
>> <routes>
>>     <route1 enable="yes">....</route1>
>>     <route2 enable="yes">....</route2>
>>     <route3 enable="no">....</route3>
>> </routes>
>>
>> how to start the route1 and route2, i must control it by java coding?
>>
>
>
> -----
> Ben O'Day
> IT Consultant -http://consulting-notes.com
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/how-to-design-which-routes-be-start-in-my-application-tp4583090p4583710.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: how to design which routes be start in my application?

Posted by boday <be...@initekconsulting.com>.
you can use the autoStartup attribute along with properties to do this...like
this

<route id="foo" autoStartup="{{cool.foo.startup}}">


xiangqiuzhao wrote:
> 
> if my application use route config like :
> 
> <routes>
>     <route1 enable="yes">....</route1>
>     <route2 enable="yes">....</route2>
>     <route3 enable="no">....</route3>
> </routes>
> 
> how to start the route1 and route2, i must control it by java coding?
> 


-----
Ben O'Day
IT Consultant -http://consulting-notes.com

--
View this message in context: http://camel.465427.n5.nabble.com/how-to-design-which-routes-be-start-in-my-application-tp4583090p4583710.html
Sent from the Camel - Users mailing list archive at Nabble.com.