Camel 2.XX: Place a properties file (.cfg) in a subdirectory of the etc directory to load a property using cm: property-placeholder

blueprint.xml

<cm:property-placeholder persistent-id="client.service"
    update-strategy="reload">
    <cm:default-properties>
        <cm:property name="URI"
            value="https://blabla/" />
        <cm:property name="ConnectionTimeout" value="18000" />
        <cm:property name="ResponseTimeout" value="10000" />
    </cm:default-properties>
</cm:property-placeholder>

<bean id="configData"
    class=" com.myproject.ConfigurationData">
    <property name="URI" value="${URI}" />
    <property name="ConnectionTimeout" value="${ConnectionTimeout}" />
    <property name="ResponseTimeout" value="${ResponseTimeout}" />
</bean>

      

Here, in the default case, I need to put the client.service.cfg file in the $ {karaf.home} / etc directory, but I want the client.service.cfg file in a subdirectory of the etc. directory. For example $ {karaf.home} / etc / client1 /

+3


source to share


1 answer


Finally, we decided to change the servicemix configuration to read a configuration file (.cfg) from multiple locations as follows.

Update the value of the felix.fileinstall.dir property in the config.properties file in the folder itself. For example.



 felix.fileinstall.dir = ${karaf.base}/etc,${karaf.base}/etc/client1

      

So now servicemix will read and dynamically reload the property from etc as well as the atc / client1 directories.

+1


source







All Articles