guohao commented on code in PR #10055:
URL: https://github.com/apache/dubbo/pull/10055#discussion_r877796171


##########
dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/metadata/ConfigurableMetadataServiceExporter.java:
##########
@@ -111,10 +115,17 @@ private ProtocolConfig generateMetadataProtocol() {
                 Protocol protocol = 
applicationModel.getExtensionLoader(Protocol.class).getExtension(specifiedProtocol);
                 if (protocol != null && protocol.getServers() != null) {
                     Iterator<ProtocolServer> it = 
protocol.getServers().iterator();
+                    // metadata service may export before normal service 
export, it.hasNext() will return false.
+                    // so need use specified protocol port.
                     if (it.hasNext()) {
                         String addr = it.next().getAddress();
                         String rawPort = addr.substring(addr.indexOf(":") + 1);
                         protocolConfig.setPort(Integer.parseInt(rawPort));
+                    } else {
+                        Integer protocolPort = 
getProtocolConfig(specifiedProtocol).getPort();

Review Comment:
   Why use `protocol port` instead of specified`port` 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: [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