0 Replies Latest reply on Nov 2, 2015 7:43 PM by writemevenkat

    Camel-Hazelcast: Custom Configuration hazelcast.xml in JBoss Fuse (6.1.0.redhat-379)

    writemevenkat

      I'm trying to implement the distributed cache using camel-hazlecast component.  I have installed camel-hazelcast feature in fuse container and tested with the sample camel route (using Aries Blueprint) which is working fine with default hazelcast configuration. In order to form a cluster, I need to provide the member information,group name and password using the custom hazelcast.xml configuration.

       

      By default the hazelcast component is searching for hazelcast.xml file in the classpath/file based on -Dhazelcast.config system property. I can see the below code implementation in hazelcast jar.

       

      XmlConfigBuilder=> String configFile = System.getProperty("hazelcast.config");

       

      In order to provide the custom hazelcast.xml configuration. I can able to achieve this using either option #1 or #2. 

       

      Working Options:

      #1.Place custom hazelcast.xml file in /app/server/jboss-fuse-6.1.0.redhat-379/hazelcast.xml and deploy the bundle, bundle loads the custom hazelcast.xml file and connects to its members.

      #2. Update karaf script with -Dhazelcast.config = /app/server/mycache/hazelcast.xml and start the server. Even now bundle loads custom hazelcast.xml file placed in the location /app/server/mycache/hazelcast.xml and connects to its members.

       

      But we have an environment limitations where these 2 options are not feasible. Is there any way that I can set this system property -Dhazelcast.config in my blueprint.xml ? I tried as below but it is not working.

       

      <ext:property-placeholder>

           <ext:default-properties>

                  <ext:property name="hazelcast.config" value="classpath:custom-hazelcast.xml" />

           </ext:default-properties>

      </ext:property-placeholder>

       

      Any help would be appreciated.