蓝图.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>
默认情况下,我需要将 client.service.cfg 文件放在 ${karaf.home}/etc 目录中,但是 我想要 etc 目录的子目录中的 client.service.cfg 文件。例如 ${karaf.home}/etc/client1/
最佳答案
最后,我们决定更改servicemix的配置,通过以下方式从多个位置读取配置(.cfg)文件。
在 etc 文件夹本身的 config.properties 文件中更新属性 felix.fileinstall.dir 的值。例如。
felix.fileinstall.dir = ${karaf.base}/etc,${karaf.base}/etc/client1
因此,现在 servicemix 将从 etc 以及 atc/client1 目录读取并动态重新加载属性。
关于apache-camel - Camel 2.X.X : Put property file(. cfg) 在 etc 目录的子目录中使用 cm:property-placeholder 加载属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30589006/