Options for setting "java system properties" in fuse

Posted on

Background: I am working on adding inifinispan cache to a webservice of mine that runs on fuse 6.1, with infinispan in "library mode", with a jgroups configuration to cluster the cache nodes for replication using TCP (we don't route UPD on our network). I have it all working fine when I use java command line arguments to set some of the jgroups properties like this:

initial_hosts="${my.service.cache.cluster.hosts}"
port_range="5"
num_initial_members="2"
ergonomics="false"/>

Question: I'd rather not change the karaf java command line for this...this is a total newb question, but what are my options for setting "java system properties" for use by an OSGi bundle? My preference would be to use something like this from blueprint:

<cm:property-placeholder persistent-id="myService" update-strategy="reload">
    <cm:default-properties>        
        <cm:property name="my.service.cache.cluster.hosts"  value="localhost[7800],localhost[7801]"/>
    </cm:default-properties>
</cm:property-placeholder>

so that this can be controlled using /etc/myService.cfg, but this doesn't seem to work (the property place holder itself works - I can log this property from a camel route - but jgroups doesn't seem to see this property). I've also tried just creating a .properties file in my bundle's resource directory, and tried this from blueprint:

<bean id="jgroupsProperties" class="org.apache.camel.component.properties.PropertiesComponent">
    <property name="location" value="classpath:jgroups.properties"/>
</bean>

but this didn't seem to work either. I'm pretty sure I must be missing something basic.

Responses