lishangbu commented on a change in pull request #9807:
URL: https://github.com/apache/dubbo/pull/9807#discussion_r831041142



##########
File path: 
dubbo-metadata/dubbo-metadata-api/src/main/java/org/apache/dubbo/metadata/report/MetadataReportInstance.java
##########
@@ -82,7 +81,7 @@ public void init(List<MetadataReportConfig> 
metadataReportConfigs) {
     private void init(MetadataReportConfig config, MetadataReportFactory 
metadataReportFactory) {
         URL url = config.toUrl();
         if (METADATA_REPORT_KEY.equals(url.getProtocol())) {
-            String protocol = url.getParameter(METADATA_REPORT_KEY, 
DEFAULT_DIRECTORY);
+            String protocol = url.getParameter(METADATA_REPORT_KEY, 
config.getProtocol());

Review comment:
       If end users want to use metadata  report center correctly,they must 
config ```dubbo.metadata-report.address ```like 
```protocol://ip:port```,otherwise,they must config 
```dubbo.metadata-report.address```,```dubbo.metadata-report.port``` and 
```dubbo.metadata-report.protocol ```.If we give a default value ```dubbo```(Of 
course it is wrong),then when properties isn't correct,the application cannot 
start up successfully and application throws exception like 
```java.lang.IllegalStateException: No such extension 
org.apache.dubbo.metadata.report.MetadataReportFactory by name dubbo, no 
related exception was found, please check whether related SPI module is 
missing.```
   But if we don't give default value,the application will start up 
successfully but the metadata report center cannot work
    So I think we need to print a error log better than give default value 
dubbo.
   




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