thubbo / jmeter-plugins-for-apache-dubbo

Dubbo Plugin for Apache JMeter, It is a plug-in developed for testing Dubbo in Jmeter.
Apache License 2.0
565 stars 290 forks source link

dubbo客户端版本>=v2.7.5调用server端版本<=v2.6.x出现No Provider错误(by Zookeeper RegistryCenter) #125

Open ningyu1 opened 3 years ago

ningyu1 commented 3 years ago

Same issue:https://github.com/apache/dubbo/issues/6694

环境配置

注册中心:zookeeper 配置中心:无 dubbo服务端版本:v2.5.x,v.2.6.x dubbo客户端版本:v2.7.7,v2.7.8,v2.7.6,v2.7.5

问题原因

dubbo v2.7.7版本org.apapche.dubbo.common.URL.getParameter()中删除了default.xxxx的获取,代码如下:

public String getParameter(String key) {
        return parameters.get(key);
}

dubbo v2.7.4版本org.apapche.dubbo.common.URL.getParameter()代码对比:

public String getParameter(String key) {
        String value = parameters.get(key);
        return StringUtils.isEmpty(value) ? parameters.get(DEFAULT_KEY_PREFIX + key) : value;
}

当Server端dubbo版本是旧版本时(这里测试使用的是dubbo v2.5.3、v2.6.6),获取到的Provider URL中只有default.version。

从而导致org.apache.dubbo.common.utils.UrlUtils.isMatch()在进行consumerVersionproviderVersion对比时不相等并返回false,丢掉了这个provider的信息。