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 2021/09/10 15:26:46 UTC

[GitHub] [dubbo] changfubai commented on a change in pull request #8769: fix issue-7656: When using multiple protocols and having port specifiā€¦

changfubai commented on a change in pull request #8769:
URL: https://github.com/apache/dubbo/pull/8769#discussion_r706273405



##########
File path: dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ServiceConfig.java
##########
@@ -756,17 +756,17 @@ private Integer findConfigedPorts(ProtocolConfig protocolConfig,
             }
         }
 
-        // save bind port, used as url's key later
-        map.put(BIND_PORT_KEY, String.valueOf(portToBind));
-
         // registry port, not used as bind port by default
         String portToRegistryStr = getValueFromConfig(protocolConfig, DUBBO_PORT_TO_REGISTRY);
         Integer portToRegistry = parsePort(portToRegistryStr);
-        if (portToRegistry == null) {
-            portToRegistry = portToBind;
+        if (portToRegistry != null) {
+            portToBind = portToRegistry;
         }
 
-        return portToRegistry;
+        // save bind port, used as url's key later
+        map.put(BIND_PORT_KEY, String.valueOf(portToBind));

Review comment:
       if registryPort is not null,  make bindPort = registryPort
   put bindPort into map.
   return bindPort.




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