1 Reply Latest reply on Jan 14, 2015 3:02 PM by Shawn Schellinger

    Common CFG File Reference in Multiple Blueprints

    Shawn Schellinger Newbie

      I have a question about referencing CFG files in Camel Blueprints.  We would like to have a common CFG file that is referenced in multiple of our Blueprint XML files.  This common CFG would have things like the ActiveMQ broker URL, user name, encrypted password, and other environment-specific properties like target web service URLs that may change from dev to test to production.  We also plan on putting update-strategy="reload" on the property-placeholder element for this common CFG file as well as changing its placeholder-prefix and -suffix so as not to collide with a Blueprint-specific CFG file we'll also define in our blueprint.  Something like this (where the the bolded property-placeholder below will appear in all of our blueprints):

       

      <cm:property-placeholder id="commonProperties" persistent-id="common" placeholder-prefix="[[" placeholder-suffix="]]" update-strategy="reload"/>

         

      <cm:property-placeholder id="routeSpecificProperties" persistent-id="route.specific" update-strategy="reload">

       

      We have this working perfectly, but we have recently been told this is a bad idea.  Can anyone independently confirm or deny that?  Thanks.

       

      Shawn

       

      p.s.  We are using Fuse V6.1.0 in case that is important to the discussion.

        • 1. Re: Common CFG File Reference in Multiple Blueprints
          Shawn Schellinger Newbie

          Well, I guess I get to answer my own question!  The issue is that when Karaf detects that a CFG file has changed, it will tell all bundles that reference that CFG to reload if necessary.  But then it retouches that CFG file which could result in the bundles that reference the CFG file to reload again, endlessly.  So this could potentially cause an endless series of bundle restarts when you change a CFG file used by multiple bundles.