Commit 3a02ebb6 authored by 赵啸非's avatar 赵啸非

调整pom文件

parent ad1068f0
...@@ -21,6 +21,8 @@ import org.springframework.beans.factory.annotation.Value; ...@@ -21,6 +21,8 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import java.util.LinkedHashSet;
/** /**
* 初始化设备消费者注册 * 初始化设备消费者注册
* *
...@@ -63,11 +65,17 @@ public class DeviceComsumersRegisterService implements IApplicationStartedServic ...@@ -63,11 +65,17 @@ public class DeviceComsumersRegisterService implements IApplicationStartedServic
//判断是否为 //判断是否为
if (!ObjectUtils.isEmpty(deviceUpdateComsumerIp)) { if (!ObjectUtils.isEmpty(deviceUpdateComsumerIp)) {
//判断指定了ip是否与启动节点的ip一致,如果一致则启动当前节点 //判断指定了ip是否与启动节点的ip一致,如果一致则启动当前节点
final String localIp = NetUtil.getLocalhostStr(); // final String localIp = NetUtil.getLocalhostStr();
LinkedHashSet<String> ipSet = NetUtil.localIpv4s();
if(!ObjectUtils.isEmpty(ipSet)){
for (String localIp : ipSet) {
log.info("get Ip...-->" + localIp); log.info("get Ip...-->" + localIp);
if (deviceUpdateComsumerIp.equals(localIp)) { if (deviceUpdateComsumerIp.equals(localIp)) {
log.info("设备更新消费线程启动"); log.info("设备更新消费线程启动");
deviceUpdateComsumerThread.start(); deviceUpdateComsumerThread.start();
break;
}
}
} }
} else { } else {
log.info("设备更新消费线程启动"); log.info("设备更新消费线程启动");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment