BurningCN commented on a change in pull request #9604:
URL: https://github.com/apache/dubbo/pull/9604#discussion_r789433015



##########
File path: 
dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/directory/AbstractDirectory.java
##########
@@ -148,26 +152,26 @@ public AbstractDirectory(URL url, RouterChain<T> 
routerChain, boolean isUrlFromR
         this.queryMap = 
applicationModel.getBeanFactory().getBean(ClusterUtils.class).mergeLocalParams(queryMap);
 
         if (consumerUrl == null) {
-            String host = StringUtils.isNotEmpty(queryMap.get("register.ip")) 
? queryMap.get("register.ip") : this.url.getHost();
-            String path = queryMap.get(PATH_KEY);
-            String consumedProtocol = queryMap.get(PROTOCOL_KEY) == null ? 
DUBBO : queryMap.get(PROTOCOL_KEY);
+            String host = 
StringUtils.isNotEmpty(queryMap.get(REGISTER_IP_KEY)) ? 
queryMap.get(REGISTER_IP_KEY) : this.url.getHost();
+            String path = StringUtils.isNotEmpty(queryMap.get(PATH_KEY)) ? 
queryMap.get(PATH_KEY) : queryMap.get(INTERFACE_KEY);
+            String consumedProtocol = 
StringUtils.isNotEmpty(queryMap.get(PROTOCOL_KEY)) ? queryMap.get(PROTOCOL_KEY) 
: DUBBO;
 
             URL consumerUrlFrom = this.url
                 .setHost(host)
                 .setPort(0)
                 .setProtocol(consumedProtocol)
-                .setPath(path == null ? queryMap.get(INTERFACE_KEY) : path);
+                .setPath(path);
             if (isUrlFromRegistry) {
                 // reserve parameters if url is already a consumer url
-                consumerUrlFrom = 
consumerUrlFrom.clearParameters().setServiceModel(url.getServiceModel()).setScopeModel(url.getScopeModel());
+                consumerUrlFrom = consumerUrlFrom.clearParameters();
             }
-            this.consumerUrl = 
consumerUrlFrom.addParameters(queryMap).removeAttribute(MONITOR_KEY);
+            this.consumerUrl = consumerUrlFrom.addParameters(queryMap);

Review comment:
       It has been removed here
   
   
![image](https://user-images.githubusercontent.com/43363120/150489164-7e39b76f-9dcc-4ef0-80cb-cf29cfa8d8a2.png)
   




-- 
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]

Reply via email to