Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

怎么让 disconf 托管 applicationContext.xml 中的dubbo 注册地址? #19

Open
goozi opened this issue Oct 22, 2018 · 0 comments
Open

Comments

@goozi
Copy link

goozi commented Oct 22, 2018

您好!
我的业务场景是这样的
项目使用 dubbo,微服务很多,所以想有一个统一的配置中心。
applicationContext.xml 中配置了 dubbo的一些配置,比如dubbo注册中心地址我想通过 disconf 来管理
但现在发现启动时会报错,说解析不了${zookeeper.host},这里的zookeeper.host是我在 disconf 上传的配置文件中的一个配置项
期待您的回复!

以下的是我的 disconf.xml 内容





<!-- 使用托管方式的disconf配置(无代码侵入, 配置更改会自动reload)-->
<bean id="configproperties_disconf"
      class="com.baidu.disconf.client.addons.properties.ReloadablePropertiesFactoryBean">
    <property name="locations">
        <list>
            <value>classpath*:resources.properties</value>
        </list>
    </property>
</bean>

<bean 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="configproperties_disconf"/>
        </list>
    </property>
</bean>

<aop:aspectj-autoproxy proxy-target-class="true"/>

其中resources.properties是我放置相关配置项的属性文件

以下是我的 disconf.properties

# 是否使用远程配置文件
# true(默认)会从远程获取配置 false则直接获取本地配置
disconf.enable.remote.conf=true

# 配置服务器的 HOST,用逗号分隔  127.0.0.1:8000,127.0.0.1:8000
disconf.conf_server_host=192.168.1.199:9527

# 版本, 请采用 X_X_X_X 格式
disconf.version=1.0

# APP 请采用 产品线_服务名 格式
disconf.app=yycx_v2.4

# 环境
disconf.env=local

# debug
disconf.debug=true

# 忽略哪些分布式配置,用逗号分隔
disconf.ignore=

# 获取远程配置 重试次数,默认是3次
disconf.conf_server_url_retry_times=1

# 获取远程配置 重试时休眠时间,默认是5秒
disconf.conf_server_url_retry_sleep_seconds=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant