|
|
@@ -40,11 +40,17 @@ public class DipperPositionServer { |
|
|
|
public DipperPositionServer() throws NacosException { |
|
|
|
//String serverAddr = positionConfigInfo.getServerAddr(); |
|
|
|
try { |
|
|
|
InetAddress ip4 = Inet4Address.getLocalHost(); |
|
|
|
try { |
|
|
|
InetAddress ip4 = Inet4Address.getLocalHost(); |
|
|
|
serverAddr = ip4.getHostAddress(); |
|
|
|
} catch (Exception ex) { |
|
|
|
serverAddr = "172.16.192.26"; |
|
|
|
ex.printStackTrace(); |
|
|
|
} |
|
|
|
String dataId = "dipperposition-service"; |
|
|
|
String group = "DEFAULT_GROUP"; |
|
|
|
Properties properties = new Properties(); |
|
|
|
properties.put(PropertyKeyConst.SERVER_ADDR, ip4.getHostAddress()); |
|
|
|
properties.put(PropertyKeyConst.SERVER_ADDR, serverAddr); |
|
|
|
ConfigService configService = NacosFactory.createConfigService(properties); |
|
|
|
String content = configService.getConfig(dataId, group, 5000); |
|
|
|
|
|
|
|