disconf bean注入

disconf后台配制所需要系统参数
建一个key名称为cat-test.properties,里边配制相关自定义的系统参数键值对

disconf.properties

conf_server_host=10.2.81.26:8286
version=1.6.6
debug=true

disconf.xml

    id="disconfMgrBean" class="com.baidu.disconf.client.DisconfMgrBean" destroy-method="destroy">
    

    id="disconfMgrBean2" class="com.baidu.disconf.client.DisconfMgrBeanSecond" init-method="init" destroy-method="destroy" />

    id="disconfConfigProperties"
          class="com.baidu.disconf.client.addons.properties.ReloadablePropertiesFactoryBean">
        <property name="locations">
            <list>
                classpath:/cat-test.properties
            list>
        property>
    

    id="propertyConfigurer"
          class="com.baidu.disconf.client.addons.properties.ReloadingPropertyPlaceholderConfigurer">
        <property name="ignoreResourceNotFound" value="true" />
        <property name="ignoreUnresolvablePlaceholders" value="true" />
        <property name="propertiesArray">
            <list>
                <ref bean="disconfConfigProperties"/>
            list>
        property>
    

disconf 配制注入bean的方式

id="testDisconf" class="com.meizu.spring.data.TestBean">
        <property name="s" value="${catList}" />
    

你可能感兴趣的:(disconf)