-
1. Re: camel in spring, configuring routes at deployment-time
davsclaus Oct 6, 2010 7:43 AM (in response to guest)You can use the Camel properties component
http://camel.apache.org/properties
And then there is the {{autoStartup}} attribute on the {{}} tag which you can use to set as either true or false.
I think there was a mistake in Camel 2.3/2.4 that the {{autoStartup}} attribute was forced to be a xs:boolean type and hence didnt support the properties. This has been fixed in 2.5 which is to be released in this month.
-
2. Re: camel in spring, configuring routes at deployment-time
davsclaus Oct 6, 2010 7:44 AM (in response to guest)You can then just set all routes to autoStartup=false and then enable them from Java code. There is a startRoute on the CamelContext you can use.
See also Camel in action, chapter 13.
-
3. Re: camel in spring, configuring routes at deployment-time
donaldesb Nov 10, 2010 2:17 AM (in response to davsclaus)Hi Dav,
I had tried using properties placeholder in my camel-context.xml route
The content of myprop.properties is:
cool.start=file:/esb/camellos/eat/?fileName=singtel.$
But after changing the value in the myprop.properties config file, servicemix is still using the previous cached value.
I need to restart servicemix in order for servicemix to pick up the new value from the myprop.properties config file.
But the value in ?fileName ${} placeholder can be immediately retrieved from another updated config file without restarting servicemix.
Is there a way for servicemix to read an updated value without restarting servicemix?
-
4. Re: camel in spring, configuring routes at deployment-time
davsclaus Nov 10, 2010 11:46 AM (in response to donaldesb)If you are using SMX 4.x then you need some OSGi stuff to have it be able to auto update .properties files on the fly.
-
5. Re: camel in spring, configuring routes at deployment-time
davsclaus Nov 10, 2010 2:26 PM (in response to davsclaus)I managed to find some documentation about using properties file with OSGi config
http://fusesource.com/docs/esb/4.2/deploy_osgi/DeployCamel-Packaging.html
-
6. Re: camel in spring, configuring routes at deployment-time
donaldesb Nov 12, 2010 1:42 AM (in response to davsclaus)Hi Dav,
I had tried the camel-osgi example. After "mvn clean install", I copied the
camel-osgi-4.2.0-fuse-02-00.jar
into /esb/apache-servicemix-4.2.0-fuse-02-00/deploy
then I modified the content in org.apache.servicemix.examples.cfg
to prefix=YourTransform ( . . . test . . .)
But servicemix did not pick up the new value.
After typing osgi:update (bundle id) at linux command, then servicemix start reading the new value in the config file.
Is that the normal behaviour or am i missing something?
Regards.
Edited by: donaldesb on Nov 12, 2010 6:41 AM
-
7. Re: camel in spring, configuring routes at deployment-time
ffang Nov 12, 2010 1:54 AM (in response to donaldesb)Hi,
Yeah, you need update or restart the bundle to pick up the new property value.
Freeman
-
8. Re: camel in spring, configuring routes at deployment-time
njiang Nov 25, 2010 2:29 AM (in response to donaldesb)Current camel doesn't support to load the properties after the route is started, so if you change the properties you need to load the bundle again to pick up that change.
Willem