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 2018/08/16 07:37:47 UTC
[GitHub] diecui1202 closed pull request #2111: [Dubbo-2110]Fix subscript
MonitorService lack of parameters in monitoring
diecui1202 closed pull request #2111: [Dubbo-2110]Fix subscript MonitorService lack of parameters in monitoring
URL: https://github.com/apache/incubator-dubbo/pull/2111
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/dubbo-config/dubbo-config-api/src/main/java/com/alibaba/dubbo/config/AbstractInterfaceConfig.java b/dubbo-config/dubbo-config-api/src/main/java/com/alibaba/dubbo/config/AbstractInterfaceConfig.java
index 6fbed0abe3..45a9ab33c7 100644
--- a/dubbo-config/dubbo-config-api/src/main/java/com/alibaba/dubbo/config/AbstractInterfaceConfig.java
+++ b/dubbo-config/dubbo-config-api/src/main/java/com/alibaba/dubbo/config/AbstractInterfaceConfig.java
@@ -36,6 +36,8 @@
import com.alibaba.dubbo.rpc.cluster.Cluster;
import com.alibaba.dubbo.rpc.support.MockInvoker;
+import static com.alibaba.dubbo.common.utils.NetUtils.isInvalidLocalHost;
+
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -226,7 +228,16 @@ protected URL loadMonitor(URL registryURL) {
if (ConfigUtils.getPid() > 0) {
map.put(Constants.PID_KEY, String.valueOf(ConfigUtils.getPid()));
}
+ //set ip
+ String hostToRegistry = ConfigUtils.getSystemProperty(Constants.DUBBO_IP_TO_REGISTRY);
+ if (hostToRegistry == null || hostToRegistry.length() == 0) {
+ hostToRegistry = NetUtils.getLocalHost();
+ } else if (isInvalidLocalHost(hostToRegistry)) {
+ throw new IllegalArgumentException("Specified invalid registry ip from property:" + Constants.DUBBO_IP_TO_REGISTRY + ", value:" + hostToRegistry);
+ }
+ map.put(Constants.REGISTER_IP_KEY, hostToRegistry);
appendParameters(map, monitor);
+ appendParameters(map, application);
String address = monitor.getAddress();
String sysaddress = System.getProperty("dubbo.monitor.address");
if (sysaddress != null && sysaddress.length() > 0) {
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org