dubbo icon indicating copy to clipboard operation
dubbo copied to clipboard

当dubbo使用nacos做注册中心的时候,该如何选择namespace呢?

Open cielswift opened this issue 6 years ago • 5 comments

dubbo: #dubbo配置 registry: address: nacos://127.0.0.1:13100?backup=127.0.0.1:13101,127.0.0.1:13102 #使用nacos注册中心

这里会导致dubbo把所有的调用都注册到public 上;

我在配置里没有找到关于namespace的配置; 网路上也找不到关于修改namespace的;

cielswift avatar Feb 16 '20 04:02 cielswift

address: nacos://127.0.0.1:13100?namespace={namespace id} 这样

liuhonglin avatar Feb 16 '20 06:02 liuhonglin

太感谢了

cielswift avatar Feb 16 '20 08:02 cielswift

dubbo.properties:

# dubbo底层参数绑定基于 spring-bean的 org.springframework.beans.MutablePropertyValues
# 所以,spring 4 与 spring 5 的语法可能不一样
# dubbo.registry.parameters.namespace=xxx

# spring-bean 5.2.2.RELEASE 成功绑定并注册到指定的namespace
dubbo.registry.parameters[namespace]=xxx  

vergilyn avatar Mar 18 '20 06:03 vergilyn

同时注册到多namespace的呢

rick-2023 avatar May 30 '20 09:05 rick-2023

dubbo.properties:

# dubbo底层参数绑定基于 spring-bean的 org.springframework.beans.MutablePropertyValues
# 所以,spring 4 与 spring 5 的语法可能不一样
# dubbo.registry.parameters.namespace=xxx

# spring-bean 5.2.2.RELEASE 成功绑定并注册到指定的namespace
dubbo.registry.parameters[namespace]=xxx  

为什么我只能使用这种方式:address: nacos://127.0.0.1:13100?namespace={namespace id} 是可以的;

yangzhiw avatar Nov 27 '20 11:11 yangzhiw