chickenlj commented on code in PR #13971:
URL: https://github.com/apache/dubbo/pull/13971#discussion_r1542428296


##########
dubbo-metadata/dubbo-metadata-api/src/main/java/org/apache/dubbo/metadata/report/support/AbstractMetadataReportFactory.java:
##########
@@ -89,6 +91,12 @@ public MetadataReport getMetadataReport(URL url) {
     }
 
     protected String toMetadataReportKey(URL url) {
+        String namespace = url.getParameter(NAMESPACE_KEY);
+        if (!StringUtils.isEmpty(namespace)) {
+            return URL.valueOf(url.toServiceString())
+                    .addParameter(NAMESPACE_KEY, namespace)
+                    .toString();
+        }

Review Comment:
   Can you describe the difference between the new url and the old url?



##########
dubbo-common/src/main/java/org/apache/dubbo/config/RegistryConfig.java:
##########
@@ -220,12 +219,6 @@ public RegistryConfig(ApplicationModel applicationModel, 
String address, String
         setProtocol(protocol);
     }
 
-    @Override
-    @Parameter(key = REGISTRY_CLUSTER_KEY)
-    public String getId() {
-        return super.getId();
-    }
-

Review Comment:
   Please keep this method and only remove `@Parameter(key = 
REGISTRY_CLUSTER_KEY)`.



##########
dubbo-metadata/dubbo-metadata-api/src/main/java/org/apache/dubbo/metadata/report/support/AbstractMetadataReportFactory.java:
##########
@@ -89,6 +91,12 @@ public MetadataReport getMetadataReport(URL url) {
     }
 
     protected String toMetadataReportKey(URL url) {
+        String namespace = url.getParameter(NAMESPACE_KEY);
+        if (!StringUtils.isEmpty(namespace)) {
+            return URL.valueOf(url.toServiceString())
+                    .addParameter(NAMESPACE_KEY, namespace)
+                    .toString();
+        }

Review Comment:
   How about making it a public util method to make calling it in other places 
easier? like here 
https://github.com/apache/dubbo/pull/13971/files#diff-17a0f234d88728ebc6f37959d84276704ca16846cd10cd0743616a8689949eabR33



-- 
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-unsubscr...@dubbo.apache.org

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


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

Reply via email to