版本:dubbo3.0.5 + nacos2.02
问题示例:
消费者A,默认消费组
- @Service
- public class CustomerA {
-
- @DubboReference(timeout = 10_000)
- private Oceanus oceanus;
-
- public String hello(String name){
- return "hello," + name;
- }
- }
消费者B,默认消费组
- @Service
- public class CustomerB {
-
- @DubboReference
- private Oceanus oceanus;
-
- public String hello(String name){
- return "hello," + name;
- }
- }
消费A所在的应用启动之后,消费者B所在的应用就无法启动,显示一下报错
org.apache.dubbo.rpc.RpcException: No provider available in [invoker :interface com.test.provider.service.Oceanus -> spring-cloud://localhost:9090/org.apache.dubbo.registry.RegistryService?application=dubbo-consumer&check=false&dubbo=2.0.2&init=false&interface=com.test.provider.service.Oceanus&methods=test&pid=60304&protocol=dubbo&qos.enable=false®ister.ip=172.21.64.110&release=2.7.6&side=consumer&sticky=false×tamp=1638255271391&version=1.0.0,directory: org.apache.dubbo.registry.integration.RegistryDirectory@6167a456, invoker :interface com.test.provider.service.Oceanus -> nacos://localhost:8848/org.apache.dubbo.registry.RegistryService?application=dubbo-consumer&check=false&dubbo=2.0.2&init=false&interface=com.test.provider.service.Oceanus&methods=test&pid=60304&protocol=dubbo&qos.enable=false®ister.ip=172.21.64.110&release=2.7.6&side=consumer&sticky=false×tamp=1638255271391&version=1.0.0,directory: org.apache.dubbo.registry.integration.RegistryDirectory@51b11186]
解决原因:dubbo3.0不允许同一个消费组内设置的消费者参数不一致,也就是说在同一个组内,比如设置了timeout,同一个组所有消费者都得设置