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 参数,导致路由规则匹配失败  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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
