dubbo icon indicating copy to clipboard operation
dubbo copied to clipboard

Multiple protocols of a service can't work when use nacos registry

Open zgs225 opened this issue 3 years ago • 6 comments

  • [x] I have searched the issues of this repository and believe that this is not a duplicate.

Environment

  • Dubbo version: 3.0.2
  • Operating System version: MacOs BigSur
  • Java version: 1.8
  • Nacos version: 2.1

Steps to reproduce this issue

  1. use nacos as registry
  2. config a provider to support multiple protocols
  3. start the application, then only last protocol works

Pls. provide [GitHub address] to reproduce this issue.

Expected Behavior

Actual Behavior

When use multiple protocols, dubbo send multiple registry urls to nacos, but the previous will be overrided.

If there is an exception, please attach the exception trace:

Just put your stack trace here!

zgs225 avatar Jun 16 '22 11:06 zgs225

可以多提供一些信息方便社区复现吗

wangchengming666 avatar Jun 21 '22 09:06 wangchengming666

可以使用最新稳定版本。provider开启如tri、dubbo协议后,消费者不指定协议的情况下是会选其中一个调用的

yuchang01 avatar Jun 21 '22 14:06 yuchang01

当我使用如下配置注册 provider 以使其同时支持 tri 和 dubbo 协议时,如果注册中心是 nacos ,那么只有最后一种协议生效。如果换成 zookeeper ,那么两个协议都支持。

<!-- 连接到哪个本地注册中心 -->
<dubbo:registry id="dubbogo"  address="nacos://127.0.0.1:8848" />
<!-- 用dubbo协议在20880端口暴露服务 -->
<dubbo:protocol name="tri" host="127.0.0.1" port="20010" />
<dubbo:protocol name="dubbo" host="127.0.0.1" port="20011" />
<!-- 声明需要暴露的服务接口 -->
<dubbo:service id="aaa" registry="dubbogo" timeout="3000" interface="org.apache.dubbo.sample.UserProvider" ref="demoService" protocol="dubbo,tri"/>

zgs225 avatar Jun 22 '22 01:06 zgs225

可以使用最新稳定版本。provider开启如tri、dubbo协议后,消费者不指定协议的情况下是会选其中一个调用的

目前我使用的 dubbo-spring-boot-starter 版本为 3.0.8,已经是最新版。

zgs225 avatar Jun 22 '22 01:06 zgs225

相关issue:https://github.com/apache/dubbo/issues/10196 这个问题也是 serviceProtocolKey 不支持泛匹配导致的

AlbumenJ avatar Jun 28 '22 12:06 AlbumenJ

Will be fixed in https://github.com/apache/dubbo/pull/10256

AlbumenJ avatar Jul 12 '22 03:07 AlbumenJ

Please try the latest 3.0.11 release

chickenlj avatar Sep 02 '22 05:09 chickenlj