填充初始化数据

This commit is contained in:
mll
2022-09-15 21:32:23 +08:00
parent f164e7954b
commit 5266cd93de
4 changed files with 17 additions and 6 deletions

View File

@@ -40,11 +40,20 @@ public class NacosXmlELParser extends ClassXmlFlowELParser {
if (StrUtil.isBlank(nacosParserVO.getServerAddr())){
nacosParserVO.setServerAddr("127.0.0.1:8848");
}
if (StrUtil.isBlank(nacosParserVO.getNamespace())){
nacosParserVO.setNamespace("");
}
if (StrUtil.isBlank(nacosParserVO.getDataId())){
nacosParserVO.setDataId("LiteFLow");
}
if (StrUtil.isBlank(nacosParserVO.getGroup())){
nacosParserVO.setGroup("LiteFLowConfig");
nacosParserVO.setGroup("LITE_FLOW_GROUP");
}
if (StrUtil.isBlank(nacosParserVO.getUsername())){
nacosParserVO.setUsername("");
}
if (StrUtil.isBlank(nacosParserVO.getPassword())){
nacosParserVO.setPassword("");
}
helper = new NacosParserHelper(nacosParserVO, parseConsumer);
}catch (Exception e){

View File

@@ -43,6 +43,9 @@ public class NacosParserHelper {
try{
Properties properties = new Properties();
properties.put(PropertyKeyConst.SERVER_ADDR, nacosParserVO.getServerAddr());
properties.put(PropertyKeyConst.NAMESPACE,nacosParserVO.getNamespace());
properties.put(PropertyKeyConst.USERNAME,nacosParserVO.getUsername());
properties.put(PropertyKeyConst.PASSWORD,nacosParserVO.getPassword());
this.configService = NacosFactory.createConfigService(properties);
CONFIG_MAP.put("Content",configService.getConfig(nacosParserVO.getDataId(), nacosParserVO.getGroup(), 3000L));
}catch (Exception e){
@@ -86,7 +89,6 @@ public class NacosParserHelper {
}
});
}catch (Exception ex){
LOG.error("listener Exception {} " , ex.getMessage());
throw new NacosException(ex.getMessage());
}
}