3 Replies Latest reply on Oct 12, 2010 7:04 AM by varadhan

    Flexible camel route configuration

    t0m.guenter

      Hi,

       

      I'm wondering if there is a possibility to make the configuration of camel routes a bit more flexible.

       

      In my SMX 4.3 application I have some camel routes defined which are triggered by a Quartz endpoint. For test purposes it would be really usefull to change the cron expression of the endpoint on the fly and get it changed by restarting the application. However, the route context file is located inside a bundle and therefore there is no chance to change this setting on the file system and I have to deploy a new version of the application for every route change.

       

      Is there a way of forcing spring to scan an external folder for context files? I know that this would be possible in an ordinary application by adding the external folder to the classpath and storing the context in /META-INF/spring. However, in an OSGI container this seems to be a bit more tricky.

       

      Are there any ways of achieving the goal?

       

      Thanks in advance,

      tom

        • 1. Re: Flexible camel route configuration
          kevin.sailly

          Hi,

           

          Maybe setting your road with a propertie file :

          http://camel.apache.org/properties.html

           

          Setting the cache option to false should make your file reloaded each time...

           

          Regards,

          Kévin Sailly

          • 2. Re: Flexible camel route configuration
            ffang

            Hi,

             

            I think you can use property placeholder for your cron expression of  your camel router in SMX4, which will leverage OSGi configAdmin service so that you can put properties file in $SMX_HOME/etc folder and change the property instead of deploying a new bundle.

             

            Actually we demonstrated how to use it in camel-osgi example shipped with kit, explain how it works in the README.txt, you may need take a look.

             

            Freeman

            • 3. Re: Flexible camel route configuration
              varadhan

              hello,

               

              How to load 2 properties files in a bundle ?

               

              i tried to load 2 properties. but its loading the first one

              <!--  etc\com.abcd.ab.trees.cfg -->

              <osgix:cm-properties id="treesProps" persistent-id="com.abcd.ab.trees"/>

              <context:property-placeholder properties-ref="treesProps"/>

               

              <!--  etc\com.abcd.ab.fox.cfg -->

              <osgix:cm-properties id="foxProps" persistent-id="com.abcd.ab.fox"/>

              <context:property-placeholder properties-ref="foxProps"/>

               

              br

              varre