dubbo
dubbo copied to clipboard
当dubbo使用nacos做注册中心的时候,该如何选择namespace呢?
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的;
address: nacos://127.0.0.1:13100?namespace={namespace id} 这样
太感谢了
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
同时注册到多namespace的呢
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} 是可以的;