service调用service合理么_记录一次dubbo广播方式consumer调用报错No provider ......解决经历...

1、通过dubbo广播方式(multicast)本地启动provider和consumer

2、通过telnet查看

eb06cf8882b5a7bde5026c441ea5d300.png

396938c17cb75c7e1930e2abcb76f645.png

dubbo接口TestService发布成功

3、通过consumer调用报错

This application has no explicit mapping for /error, so you are seeing this as a fallback.

Thu Mar 12 09:54:27 CST 2020

There was an unexpected error (type=Internal Server Error, status=500).

Failed to invoke the method test in the service hao.du.dubbo.learn.service.base.TestService. No provider available for the service hao.du.dubbo.learn.service.base.TestService:1.0.0 from registry 224.5.6.19:1244 on the consumer 192.168.234.1 using the dubbo version 2.7.3. Please check if the providers have been started and registered.

发现192.168.234.1和本机ip 192.168.1.118不一样。

11acb698fe35d9c1b979baba144820b4.png

4、查资料后以为是windows虚拟机ip导入provider和consumer广播ip不一致导致,consumer找不到接口,于是关掉了虚拟机适配器,关闭后只有一个本机真实ip

1782c49eed7d6ce13e365c50e08765a9.png

5、重新启动provider和consumer,仍然报错

This application has no explicit mapping for /error, so you are seeing this as a fallback.

Thu Mar 12 09:54:27 CST 2020

There was an unexpected error (type=Internal Server Error, status=500).

Failed to invoke the method test in the service hao.du.dubbo.learn.service.base.TestService. No provider available for the service hao.du.dubbo.learn.service.base.TestService:1.0.0 from registry 224.5.6.19:1244 on the consumer 192.168.1.118 using the dubbo version 2.7.3. Please check if the providers have been started and registered.

ip倒是变过来了,但是任然找不到dubbo接口。

6、灵光一现问题解决

突然想到广播方式莫非只是启动的时候发布一下消息,然后就不管了?我之前启动方式都是按照springcloud来的先启动服务提供者再启动服务消费者,这样可能导致服务启动的时候广播出去消费者没有接收到。于是改变了服务启动顺序,果然,我凑特么的!

5a1b83e77a3cf9759d3004c6f8f856b2.png
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值