You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2021/09/27 15:50:04 UTC

[GitHub] [dubbo] haoyann opened a new issue #8940: Instance registry mode can't use mesh route

haoyann opened a new issue #8940:
URL: https://github.com/apache/dubbo/issues/8940


   - [x] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate.
   - [x] I have checked the [FAQ](https://github.com/apache/dubbo/blob/master/FAQ.md) of this repository and believe that this is not a duplicate.
   
   ### Environment
   
   * Dubbo version: 3.0.3
   
   ### Steps to reproduce this issue
   
   1. 启动 provider `-Ddubbo.application.register-mode=instance`
   2. 启动 consumer `dubbo.application.service-discovery.migration=FORCE_APPLICATION`
   3. 使用 `dubbo admin` 创建 mesh 路由
   4. `org.apache.dubbo.registry.client.InstanceAddressURL#getParameters` 不能获取真正的 url 参数,导致路由规则匹配失败
   ![image](https://user-images.githubusercontent.com/43994656/134940925-96081a6c-500c-4b71-89cc-bbd22d0be296.png)
   5. 原因在于 `getProtocolServiceKey()` 方法是从上下文中获取,此时上下文早清空,导致获取的为 instance 参数,实际需要获取对应服务的参数。
   ```
       public Map<String, String> getParameters() {
           String protocolServiceKey = getProtocolServiceKey();
           if (StringUtils.isEmpty(protocolServiceKey)) {
               return getInstance().getAllParams();
           }
           return getServiceParameters(protocolServiceKey);
       }
   ```
   ```
       public String getProtocolServiceKey() {
           return RpcContext.getServiceContext().getProtocolServiceKey();
       }
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ closed issue #8940: Instance registry mode can't use mesh route

Posted by GitBox <gi...@apache.org>.
AlbumenJ closed issue #8940:
URL: https://github.com/apache/dubbo/issues/8940


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org