3

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 default case, i need to put client.service.cfg file in ${karaf.home}/etc directory but I want client.service.cfg file in sub-directory of etc directory. For example ${karaf.home}/etc/client1/

Dhaval Patel
  • 141
  • 1
  • 9
  • 1
    On top of my head I dont think karaf supports sub folders in its etc directory. – Claus Ibsen Jun 02 '15 at 09:36
  • Thanks for reply. I updated blueprint.xml with bean in question. Is there any other way to do this type of configuration ?. – Dhaval Patel Jun 02 '15 at 10:33
  • I can read sub folders in its etc directory but for that i need to update value of felix.fileinstall.dir in config.properties in etc folder itself. For example. **felix.fileinstall.dir = ${karaf.base}/etc,${karaf.base}/etc/client1**. But i dont want to do this configuration at Servicemix, instead i want to configure my bundle to read property from specified folder. – Dhaval Patel Jun 02 '15 at 10:37
  • You would need to configure the felix file installed to scan for those sub dirs, i think its configured for etc only. Check the various SMX config files – Claus Ibsen Jun 02 '15 at 15:50
  • You are right. As i mentioned in previous comment. _"felix.fileinstall.dir = ${karaf.base}/etc,${karaf.base}/etc/client1. But i don't want to do this configuration at Servicemix's file, instead i want to configure my bundle to read property from specified folder."_. – Dhaval Patel Jun 03 '15 at 04:49
  • But i don't want to do this configuration at Servicemix's file, instead i want to **configure my bundle** to read property from specified subfolder in etc. By this way i will not require to update _config.properties_ every time i add new sub-folder in etc folder. – Dhaval Patel Jun 03 '15 at 06:38
  • 1
    And that is not possible today! – Claus Ibsen Jun 03 '15 at 08:30

1 Answers1

1

Finally, We decided to change the configuration of servicemix to read the configuration (.cfg) file from multiple locations by following way.

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

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

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

Dhaval Patel
  • 141
  • 1
  • 9