YoungHu commented on code in PR #10055:
URL: https://github.com/apache/dubbo/pull/10055#discussion_r900000126
##########
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:
if `getProtocolConfig(specifiedProtocol)` return null that means application
RPC protocol not set. if so, application will startup failed before export
metadataService.
--
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]