You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "cvictory (GitHub)" <gi...@apache.org> on 2019/01/15 04:49:40 UTC

[GitHub] [incubator-dubbo] cvictory opened issue #3231: In dubbo-2.7 tag route, dubbo 2.6 client invoke 2.7 server is well but dubbo 2.7 client invoke 2.6 donot work well

在tag route下, dubbo2.6作为client调用dubbo2.7 server,路由规则已经起效果; dubbo2.7作为client调用dubbo2.6路由规则没有生效。(在dubbo2.7,ops没有配置路由规则的前提下,只通过应用url的tag打标)。
发现问题代码, org.apache.dubbo.rpc.cluster.router.tag.TagRouter:
```
if (CollectionUtils.isEmpty(invokers)) {
            return invokers;
        }

        if (tagRouterRule == null || !tagRouterRule.isValid() || !tagRouterRule.isEnabled()) {
            return invokers;
        }
```
没在ops里配置路由规则的时候,需要继续往下走。

----transplate here 

Under tag route, dubbo2.6 calls dubbo2.7 server as client, routing rules have been effective; dubbo2.7 as client calls dubbo2.6 routing rules have not taken effect. (In dubbo2.7, ops is not configured with routing rules, only by applying the url tag).
Found the problem code, org.apache.dubbo.rpc.cluster.router.tag.TagRouter:
```
if (CollectionUtils.isEmpty(invokers)) {
            return invokers;
        }

        if (tagRouterRule == null || !tagRouterRule.isValid() || !tagRouterRule.isEnabled()) {
            return invokers;
        }
```
When you do not configure routing rules in ops, you need to continue down.

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/3231 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo] cvictory commented on issue #3231: In dubbo-2.7 tag route, dubbo 2.6 client invoke 2.7 server work well but dubbo 2.7 client invoke 2.6 donot work well

Posted by "cvictory (GitHub)" <gi...@apache.org>.
In dubbo 2.6 , there are some key points in this class com.alibaba.dubbo.rpc.cluster.directory.AbstractDirectory.
 ```
    protected void setRouters(List<Router> routers) {
        // copy list
        routers = routers == null ? new ArrayList<Router>() : new ArrayList<Router>(routers);
        // append url router
        String routerkey = url.getParameter(Constants.ROUTER_KEY);
        if (routerkey != null && routerkey.length() > 0) {
            RouterFactory routerFactory = ExtensionLoader.getExtensionLoader(RouterFactory.class).getExtension(routerkey);
            routers.add(routerFactory.getRouter(url));
        }
        // append mock invoker selector
        routers.add(new MockInvokersSelector());
        Collections.sort(routers);
        this.routers = routers;
    }
```

so should we keep this logic code ?

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/3231 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [incubator-dubbo] chickenlj commented on issue #3231: In dubbo-2.7 tag route, dubbo 2.6 client invoke 2.7 server work well but dubbo 2.7 client invoke 2.6 donot work well

Posted by "chickenlj (GitHub)" <gi...@apache.org>.
> ```java
> if (tagRouterRule == null || !tagRouterRule.isValid() || !tagRouterRule.isEnabled()) {
>             return invokers;
> }
```
I will try to remove this 2.7 specific empty limitation. 

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/3231 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [incubator-dubbo] cvictory closed issue #3231: In dubbo-2.7 tag route, dubbo 2.6 client invoke 2.7 server work well but dubbo 2.7 client invoke 2.6 donot work well

Posted by "cvictory (GitHub)" <gi...@apache.org>.
[ issue closed by cvictory ]

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/3231 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org