获取dubbo服务优化

This commit is contained in:
暮光:城中城
2020-12-20 21:58:34 +08:00
parent d1918b14e2
commit dfb1e62074
2 changed files with 5 additions and 1 deletions

View File

@@ -79,7 +79,7 @@ public class DubboController {
mgDubboStorageService.put(StorageKeys.DUBBO_SERVICE_LIST, JSON.toJSONString(providerList));
} catch (Exception e) {
e.printStackTrace();
return DocResponseJson.warn("获取服务列表失败");
return DocResponseJson.warn("获取服务列表失败" + e.getMessage());
}
return DocResponseJson.ok();
}

View File

@@ -19,6 +19,10 @@ public class ReferenceConfigHolder {
String url = "dubbo://" + dubboNodeInfo.getIp() + ":" + dubboNodeInfo.getPort();
String referenceKey = url + "_" + StringUtils.defaultIfBlank(dubboNodeInfo.getVersion(), "0") + "_" + StringUtils.defaultIfBlank(dubboNodeInfo.getGroup(), "0");
ReferenceConfig referenceConfig = referenceConfigMap.get(referenceKey);
if (referenceConfig != null && referenceConfig.get() == null) {
referenceConfig.destroy();
referenceConfig = null;
}
if (referenceConfig == null) {
synchronized (ReferenceConfigHolder.class) {
ApplicationConfig application = new ApplicationConfig();