Multiple protocols of a service can't work when use nacos registry
- [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
- use nacos as registry
- config a provider to support multiple protocols
- 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!
可以多提供一些信息方便社区复现吗
可以使用最新稳定版本。provider开启如tri、dubbo协议后,消费者不指定协议的情况下是会选其中一个调用的
当我使用如下配置注册 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"/>
可以使用最新稳定版本。provider开启如tri、dubbo协议后,消费者不指定协议的情况下是会选其中一个调用的
目前我使用的 dubbo-spring-boot-starter 版本为 3.0.8,已经是最新版。
相关issue:https://github.com/apache/dubbo/issues/10196 这个问题也是 serviceProtocolKey 不支持泛匹配导致的
Will be fixed in https://github.com/apache/dubbo/pull/10256
Please try the latest 3.0.11 release