You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2022/03/19 05:10:41 UTC

[GitHub] [dubbo] lishangbu opened a new pull request #9807: fix dubbo.metadata-report.protocol cannot be applied

lishangbu opened a new pull request #9807:
URL: https://github.com/apache/dubbo/pull/9807


   ## What is the purpose of the change
   
   fix #9806
   
   ## Brief changelog
   
   fix a bug: ```dubbo.metadata-report.protocol``` cannot be applied
   
   ## Verifying this change
   
   
   <!-- Follow this checklist to help us incorporate your contribution quickly and easily: -->
   
   ## Checklist
   - [x] Make sure there is a [GitHub_issue](https://github.com/apache/dubbo/issues) field for the change (usually before you start working on it). Trivial changes like typos do not require a GitHub issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
   - [ ] Each commit in the pull request should have a meaningful subject line and body.
   - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
   - [ ] Check if is necessary to patch to Dubbo 3 if you are work on Dubbo 2.7
   - [ ] Write necessary unit-test to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add sample in [dubbo samples](https://github.com/apache/dubbo-samples) project.
   - [ ] Add some description to [dubbo-website](https://github.com/apache/dubbo-website) project if you are requesting to add a feature.
   - [ ] GitHub Actions works fine on your own branch.
   - [ ] If this contribution is large, please follow the [Software Donation Guide](https://github.com/apache/dubbo/wiki/Software-donation-guide).
   


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

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



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


[GitHub] [dubbo] chickenlj commented on a change in pull request #9807: fix dubbo.metadata-report.protocol cannot be applied

Posted by GitBox <gi...@apache.org>.
chickenlj commented on a change in pull request #9807:
URL: https://github.com/apache/dubbo/pull/9807#discussion_r830737032



##########
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:
       `url.getParameter(METADATA_REPORT_KEY, isEmpty(config.getProtocol()) ? dubbo :config.getProtocol() );`
   
   I think we need to check if `config.getProtocol()` is empty here.
   
   




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

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



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


[GitHub] [dubbo] chickenlj commented on a change in pull request #9807: fix dubbo.metadata-report.protocol cannot be applied

Posted by GitBox <gi...@apache.org>.
chickenlj commented on a change in pull request #9807:
URL: https://github.com/apache/dubbo/pull/9807#discussion_r831829165



##########
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:
       Please check this patch https://github.com/apache/dubbo/pull/9820
   
   I think it's better to check protocol configuration on the construction of metadata config url.




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

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



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


[GitHub] [dubbo] lishangbu commented on a change in pull request #9807: fix dubbo.metadata-report.protocol cannot be applied

Posted by GitBox <gi...@apache.org>.
lishangbu commented on a change in pull request #9807:
URL: https://github.com/apache/dubbo/pull/9807#discussion_r830972113



##########
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:
        I agree with you,but metadata report center support redis/zookeeper/nacos/…….Default value ```dubbo``` will occur a error when user‘s configuration is empty.
   so,I think we need to check the config is empty.it throws exception for user to remind that they need to config metadata report center protocol correctly.




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

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



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


[GitHub] [dubbo] lishangbu commented on a change in pull request #9807: fix dubbo.metadata-report.protocol cannot be applied

Posted by GitBox <gi...@apache.org>.
lishangbu commented on a change in pull request #9807:
URL: https://github.com/apache/dubbo/pull/9807#discussion_r831062464



##########
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:
       I add an error log when the protocol cannot be parsed correctly.




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

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



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


[GitHub] [dubbo] chickenlj commented on a change in pull request #9807: fix dubbo.metadata-report.protocol cannot be applied

Posted by GitBox <gi...@apache.org>.
chickenlj commented on a change in pull request #9807:
URL: https://github.com/apache/dubbo/pull/9807#discussion_r831736517



##########
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:
       > so,I think we need to check the config is empty.it throws exception for user to remind that they need to config metadata report center protocol correctly.
   
   Totally agree, that would be better.




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

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



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


[GitHub] [dubbo] lishangbu commented on a change in pull request #9807: fix dubbo.metadata-report.protocol cannot be applied

Posted by GitBox <gi...@apache.org>.
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: notifications-unsubscribe@dubbo.apache.org

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



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


[GitHub] [dubbo] chickenlj closed pull request #9807: fix dubbo.metadata-report.protocol cannot be applied

Posted by GitBox <gi...@apache.org>.
chickenlj closed pull request #9807:
URL: https://github.com/apache/dubbo/pull/9807


   


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

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



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