Skip to content

Commit

Permalink
fix subscription when enable monitor (#2167)
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonjoo2010 authored and zonghaishang committed Aug 2, 2018
1 parent 7cb044c commit 584de00
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,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 (NetUtils.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) {
Expand Down

0 comments on commit 584de00

Please sign in to comment.