springboot中使用dubbo多注册中心的配置方法
在工作中遇到dubbo多注册中心的需求
当前工程基于springboot 1.5.9.RELEASE dubbo 2.5.10
团队已经熟悉使用properties + springboot starter 这种方法配置集成的框架
下面是dubbo 多注册中心在 application.properties中的配置方法:
# 非常重要必须声明当前为多选方法 dubbo.config.multiple=true # 注册中心1 命名为wallet # 默认注册中心 dubbo.registries.wallet.default=true dubbo.registries.wallet.protocol=zookeeper dubbo.registries.wallet.client=zkclient # 注册中心2 命名为pay dubbo.registries.pay.protocol=zookeeper dubbo.registries.pay.client=zkclient
消费者
引用注册中心pay中的接口,默认注册中心不用定义registry属性
@Reference(registry = "pay") private FukaAccountService fukaAccountService;
生产者
发布接口到注册中心pay,默认注册中心不用定义registry属性
@Service(registry = "pay") public class GetCardBalance extends ApiInvoker<APICardBalanceReq>{
相关推荐
ATenhong 2020-10-15
supperme 2020-09-08
doctorvian 2020-08-02
aNian 2020-08-01
kongjunlongaa 2020-06-29
Fightingxr 2020-06-26
whileinsist 2020-06-24
doctorvian 2020-06-16
XuNeely 2020-06-16
wangyangsoftware 2020-06-16
大步流星 2020-06-16
aNian 2020-06-16
gaoyongstone 2020-06-16
MartellJenkins 2020-06-11
范群松 2020-06-11
Fightingxr 2020-06-08
XuNeely 2020-06-07
大步流星 2020-06-05