You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by al...@apache.org on 2021/11/28 08:43:07 UTC
[dubbo] branch 3.0 updated: fix: custom registry port (#9298)
This is an automated email from the ASF dual-hosted git repository.
albumenj pushed a commit to branch 3.0
in repository https://gitbox.apache.org/repos/asf/dubbo.git
The following commit(s) were added to refs/heads/3.0 by this push:
new 6f38fa6 fix: custom registry port (#9298)
6f38fa6 is described below
commit 6f38fa603497abd94292d63682e623c5a9734e3d
Author: monkeyWie <li...@qq.com>
AuthorDate: Sun Nov 28 16:42:59 2021 +0800
fix: custom registry port (#9298)
---
.../src/main/java/org/apache/dubbo/config/ServiceConfig.java | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ServiceConfig.java b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ServiceConfig.java
index 6cbc9c1..0a07fc3 100644
--- a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ServiceConfig.java
+++ b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ServiceConfig.java
@@ -755,17 +755,17 @@ public class ServiceConfig<T> extends ServiceConfigBase<T> {
}
}
+ // 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) {
- portToBind = portToRegistry;
+ if (portToRegistry == null) {
+ portToRegistry = portToBind;
}
- // save bind port, used as url's key later
- map.put(BIND_PORT_KEY, String.valueOf(portToBind));
-
- return portToBind;
+ return portToRegistry;
}
private Integer parsePort(String configPort) {