|
|
@@ -32,7 +32,7 @@ public class DipperPositionController { |
|
|
|
Properties properties = new Properties(); |
|
|
|
properties.put(PropertyKeyConst.SERVER_ADDR, serverAddr); |
|
|
|
ConfigService configService = NacosFactory.createConfigService(properties); |
|
|
|
String content = configService.getConfig(dataId, group, 5000); |
|
|
|
String content = configService.getConfig(dataId, group, 10000); |
|
|
|
System.out.println(content); |
|
|
|
configService.addListener(dataId, group, new Listener() { |
|
|
|
@Override |
|
|
@@ -50,21 +50,22 @@ public class DipperPositionController { |
|
|
|
log.info(String.valueOf(isPublishOk)); |
|
|
|
Thread.sleep(3000); |
|
|
|
|
|
|
|
content = configService.getConfig(dataId, group, 5000); |
|
|
|
configService = NacosFactory.createConfigService(properties); |
|
|
|
content = configService.getConfig(dataId, group, 10000); |
|
|
|
log.info(content); |
|
|
|
|
|
|
|
content = configService.getConfig(positionId, group, 5000); |
|
|
|
content = configService.getConfig(positionId, group, 10000); |
|
|
|
log.info(content); |
|
|
|
|
|
|
|
boolean isRemoveOk = configService.removeConfig(dataId, group); |
|
|
|
log.info(String.valueOf(isRemoveOk)); |
|
|
|
Thread.sleep(3000); |
|
|
|
//boolean isRemoveOk = configService.removeConfig(dataId, group); |
|
|
|
//log.info(String.valueOf(isRemoveOk)); |
|
|
|
//Thread.sleep(3000); |
|
|
|
|
|
|
|
content = configService.getConfig(dataId, group, 5000); |
|
|
|
log.info(content); |
|
|
|
Thread.sleep(30000); |
|
|
|
//content = configService.getConfig(dataId, group, 10000); |
|
|
|
//log.info(content); |
|
|
|
//Thread.sleep(30000); |
|
|
|
|
|
|
|
System.out.println(content); |
|
|
|
//System.out.println(content); |
|
|
|
|
|
|
|
return "Helle world!"; //ContextLoader.getCurrentWebApplicationContext().toString(); |
|
|
|
} |
|
|
|