You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "dai19470 (GitHub)" <gi...@apache.org> on 2019/01/30 09:58:04 UTC

[GitHub] [incubator-dubbo] dai19470 opened issue #3400: 使用出现的问题

我希望使用下面的配置获取dubbo.properties 和spring-demo.xml文件,但是没有获取到。去掉第二个配置能获取到第一个配置文件,	
<dubbo:config-center   address="zookeeper://127.0.0.1:2181" config-file="dubbo.properties"  namespace="dubbo"  />
	<dubbo:config-center   address="zookeeper://127.0.0.1:2181" config-file="spring-demo.xml"   namespace="spring" include-spring-env="true"     /> 

dubbo.properties 和spring-demo.xml 是在zookeeper同级目录里/dubbo/config/dubbo/

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/3400 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo] chickenlj commented on issue #3400: 使用出现的问题

Posted by "chickenlj (GitHub)" <gi...@apache.org>.
http://dubbo.apache.org/zh-cn/docs/user/configuration/config-center.html

只有`dubbo.properties`这一种格式是可以支持的,spring-demo.xml并不支持

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/3400 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo] chickenlj closed issue #3400: 使用出现的问题

Posted by "chickenlj (GitHub)" <gi...@apache.org>.
[ issue closed by chickenlj ]

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/3400 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [incubator-dubbo] chickenlj commented on issue #3400: 使用出现的问题

Posted by "chickenlj (GitHub)" <gi...@apache.org>.
https://github.com/apache/incubator-dubbo-website/blob/asf-site/docs/zh-cn/user/references/xml/dubbo-config-center.md

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/3400 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [incubator-dubbo] dai19470 commented on issue #3400: 使用出现的问题

Posted by "dai19470 (GitHub)" <gi...@apache.org>.
如果仅仅支持dubbo.properties一种文件那么这个功能实在是太浪费了。希望能支持多个文件的读取。另外能支持通配符获取属性
<dubbo:config-center   address="zookeeper://127.0.0.1:2181"    />  
<dubbo:config-center   address="zookeeper://127.0.0.1:2181" config-file="db.properties"    /> 
<bean id="testBean" class="org.apache.dubbo.demo.provider.TestBean"> 
		<property name="name" value="${db.username}"></property> 
</bean>	
	 

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/3400 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo] chickenlj commented on issue #3400: 使用出现的问题

Posted by "chickenlj (GitHub)" <gi...@apache.org>.
> 如果仅仅支持dubbo.properties一种文件那么这个功能实在是太浪费了。希望能支持多个文件的读取。

配置中心server肯定是可以被复用的,但是就Dubbo框架而言,我认为还是只解析自身的属性是合理的,因为它毕竟只是一个RPC框架,似乎没什么理由读取`db.properties`。这更适合Spring框架来做或者每个框架来做。

如果你觉得每个框架都对接配置中心(每个框架都要配置注册中心地址)太繁琐了,那其实是可以收敛在类似Spring的统一流程中的,起码Dubbo是支持这样做的,Dubbo会自动读Spring Env,或者你通过API传递给Dubbo,本质上Dubbo只要拿到自己需要的配置就可以共工作了。
参考[这里](http://dubbo.apache.org/zh-cn/docs/user/configuration/config-center.html)的`自己加载外部化配置`小节

>另外能支持通配符获取属性

能否有具体示例描述。

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/3400 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo] slowvic commented on issue #3400: 使用出现的问题

Posted by "slowvic (GitHub)" <gi...@apache.org>.
支持nacos作为config-center吗?

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/3400 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo] chickenlj commented on issue #3400: 使用出现的问题

Posted by "chickenlj (GitHub)" <gi...@apache.org>.
关于`config-center`各项配置的含义,马上在官网增加一个详细文档。
更详细的解释`namespace`,`include-spring-env="true"`的含义。

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/3400 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo] chickenlj commented on issue #3400: 使用出现的问题

Posted by "chickenlj (GitHub)" <gi...@apache.org>.
> 支持nacos作为config-center吗?

Nacos 的正在做适配:启动配置、服务治理、注册中心(已支持)

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/3400 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org