【发布时间】:2016-07-19 13:31:01
【问题描述】:
是否可以加载hazelcast.xml中的属性文件值。
示例:
在hazelcast.xml 文件中,
<context:property-placeholder location="/home/local/Documents/testproperty/test.properties"/>
使用上述标签加载属性文件,并使用 hazelcast xml 中的属性值,如下所示,
<properties>
<property name="hazelcast.max.no.heartbeat.seconds" value = "${HAZELCAST_MAX_NO_HEARTBEAT_SECONDS}"></property>
<property name="hazelcast.client.heartbeat.timeout" value = "${HAZELCAST_CLIENT_HEARTBEAT_TIMEOUT}"></property>
还有其他方法可以加载xml里面的属性值吗?
注意:使用加载到应用程序中 配置cfg = new XmlConfigBuilder(xmlFileName).build();
谢谢, 哈利
【问题讨论】:
-
不确定我们的实现是否 100%,但您是否尝试过 Hazelcast 的默认属性替换策略? docs.hazelcast.org/docs/3.6/manual/html-single/…
标签: java xml properties hazelcast