Dubbo:Please check if the providers have been started and registered

记一次使用Dubbo踩的坑
错误信息:

Failed to check the status of the service 
com.yaya.configuration.dubbo.service.RpcConfigurationService. No provider available for the service 
com.yaya.configuration.dubbo.service.RpcConfigurationService from the url spring-
cloud://localhost:9090/org.apache.dubbo.registry.RegistryService?application=playlist-
service&dubbo=2.0.2&init=false&interface=com.yaya.configuration.dubbo.service.RpcConfigurationService&methods=getAreaConfig,getVersionUpdated,ge
tAllConfig,getChannelConfig&pid=8520&qos.enable=false&register.ip=192.16
8.0.110&release=2.7.6&side=consumer&sticky=false&timestamp=1595218876108 
to the consumer 192.168.0.110 use dubbo version 2.7.6

要问错误缘由,便是我想通过一个消费者访问多个生产者,可是当我调用第二个生产者时,发现项目启动就报错
在这里插入图片描述
起初,查资料以为是第二个生产者是懒加载的原因,因此我在@Reference(check = false)加上了个check=false参数,然后项目顺利启动。
等我一调用ConfigurationService这个服务的接口时

 "Failed to invoke the method getChannelConfig in the service 
 com.yaya.configuration.dubbo.service.RpcConfigurationService. No 
 provider available for the service 
 com.yaya.configuration.dubbo.service.RpcConfigurationService from 
 registry localhost:9090 on the consumer 192.168.0.110 using the dubbo 
 version 2.7.6. Please check if the providers have been started and 
 registered.",

emmm…
我就知道事情没那么简单,于是乎度娘。。。谷歌。。。找了一大堆论坛博客,然并卵
然后只能翻书找资料,皇天不负有心人原来是需要加上订阅服务,并且默认是“*”表示所有在注册中心所注册的生产者都能找到
在这里插入图片描述
原来是我写了服务订阅,并且只订阅了一个生产者
在这里插入图片描述
于是乎,我加上了另外一个服务的订阅,接下来又可以愉快了划水了,2333

果然是书到用时方恨少

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值