CrazyHZM commented on a change in pull request #9820:
URL: https://github.com/apache/dubbo/pull/9820#discussion_r832801732



##########
File path: 
dubbo-common/src/main/java/org/apache/dubbo/config/MetadataReportConfig.java
##########
@@ -152,7 +153,11 @@ public URL toUrl() throws IllegalArgumentException {
         // Normalize the parameters
         map.putAll(convert(map, null));
         // put the protocol of URL as the "metadata"
-        map.put("metadata", url.getProtocol());
+        String metadataProtocol = isEmpty(url.getProtocol()) ? 
map.get(PROTOCOL_KEY) : url.getProtocol();
+        if (isEmpty(metadataProtocol)) {
+            throw new IllegalArgumentException("Please specify valid protocol 
for metadata report." + address);
+        }

Review comment:
       It is recommended to be better as a config validation, and complete the 
logic in ConfigValidationUtils#validateMetadataConfig()




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