spring-cloud-alibaba icon indicating copy to clipboard operation
spring-cloud-alibaba copied to clipboard

使用SpringCloudAlibaba整合Dubbo后,该服务不能即作为生产者又作为消费者吗?

Open lukeliujun opened this issue 5 years ago • 12 comments

我们鼓励使用英文,如果不能直接使用,可以使用翻译软件,您仍旧可以保留中文原文。 We recommend using English. If you are non-native English speaker, you can use the translation software.

Which Component eg. Nacos Discovery, Sentinel

Describe what problem you have encountered A clear and concise description of what you want to do.

Describe what information you have read eg. I have read the reference doc of Sentinel

lukeliujun avatar Jan 15 '20 07:01 lukeliujun

整合后,两个服务做测试,两个服务都是生产者和消费者,想要可以相互调用,但是测试发现,先启动的服务,无法作为消费者去消费后面启动的服务,总是会报异常:No provider available for the service xxx from registry localhost:9090 on the consumer 127.0.0.1 using the dubbo version 2.7.3. Please check if the providers have been started and registered.难道不能想feign那样吗?

lukeliujun avatar Jan 15 '20 07:01 lukeliujun

看起来是使用了循环依赖? 循环依赖的处理目前有点问题,还在优化。

fangjian0423 avatar Jan 15 '20 07:01 fangjian0423

两个即是生产者又是消费者的服务ServiceA和ServiceB,ServiceA服务暴露了A接口,ServiceB服务暴露了B接口,ServiceA服务调用B接口,ServiceB服务调用A接口,测试中发现,1、如果先启动ServiceA后启动ServiceB,那么ServiceA无法调用B接口,ServiceB服务可以调用A接口;2、如果先启动ServiceB后启动ServiceA,那么ServiceB无法调用A接口,ServiceA服务可以调用B接口;

lukeliujun avatar Jan 15 '20 07:01 lukeliujun

是不是在A接口里面调用了B接口,或B接口里面调用A接口

wujincheng2333 avatar Jan 16 '20 02:01 wujincheng2333

Here has some problems, i'm tracing the code.

echooymxq avatar Jan 16 '20 02:01 echooymxq

@wujincheng2333 不是

lukeliujun avatar Jan 16 '20 02:01 lukeliujun

@lukeliujun 你用得什么版本,我用2.1.1版本当时没测出来,当时好像相互订阅跑通了

wujincheng2333 avatar Jan 16 '20 02:01 wujincheng2333

@lukeliujun Hi, would you tell me which version you use? it only can't work on 0.9.0.RELEASE from my test.

echooymxq avatar Jan 16 '20 10:01 echooymxq

i came across the issue too !

lixiangfei4 avatar Jan 20 '20 03:01 lixiangfei4

交叉调用,需要设置dubbo.consume.check=false 参考代码:https://github.com/lcg72/testalibaba 先本地启动nacos1.1.4, 然后启动服务A和服务B(先后顺序不重要),启动后 访问服务A(调用服务B):http://127.0.0.1:18086/lcg 访问服务B(调用服务A):http://127.0.0.1:18088/testLocalDateTime

lcg72 avatar Apr 01 '20 09:04 lcg72

The problem has been found. The spring-cloud-alibaba version will have the above problems in 2.1.0.RELEASE, and the service is normal after upgrading to 2.2.0.RELEASE. thank you all!

lukeliujun avatar Apr 02 '20 08:04 lukeliujun

In dubbo configuration registration address side can not fill, fill will have a problem, see my screenshots below image

millionsteps avatar Sep 09 '21 08:09 millionsteps