- 메모리 리로드 문제 개선 (변경된 어댑터 프라퍼티 값이 반영되지않아서 수정)

This commit is contained in:
daekuk
2026-01-28 18:31:38 +09:00
parent 4c2bb72250
commit 51bbd6678b
2 changed files with 41 additions and 25 deletions
@@ -248,7 +248,7 @@ public class AdapterController extends OnlBaseAnnotationController {
synchronized (obj) {
service.update(adapterGroupUI);
Map<String, String> resultMap = service.reloadSync(adapterGroupUI);
Map<String, String> resultMap = service.reloadSyncStdMsgAndAdapter(adapterGroupUI.getAdptrbzwkgroupname());
return ResponseEntity.ok(resultMap);
}
@@ -333,8 +333,6 @@ public class AdapterManService extends OnlBaseService {
List<StandardMessageInfo> stdMsgInfoList = standardmessageinfoService.findByBzwksvckeynameStartingWith(adapterName);
// 변경 사항이 있었는지 체크해서 HS04 Reload 함.
boolean isUpdated = false;
for (StandardMessageInfo stdMsgInfo : stdMsgInfoList) {
String fullPath = stdMsgInfo.getApifullpath();
@@ -358,8 +356,6 @@ public class AdapterManService extends OnlBaseService {
// DB에 즉시 반영
standardmessageinfoService.saveAndFlush(stdMsgInfo);
isUpdated = true;
} catch (Exception e) {
log.error("StandardMessageInfo APIFULLPATH SAVE FAIL key = {}", stdMsgInfo.getBzwksvckeyname());
@@ -374,22 +370,6 @@ public class AdapterManService extends OnlBaseService {
}
}
if (isUpdated) {
try {
Command command = new ReloadSTDMessageCommand();
command.setArgs("ALL");
agentUtilService.broadcast(command);
log.debug("API 경로 변경 감지 -> 전체 표준 전문 리로드 명령 전송 완료 (ALL)");
} catch (Exception e) {
log.debug("브로드캐스트 전송 실패", e);
}
}
}
public void delete(AdapterGroupUI adapterGroupUI) {
@@ -559,7 +539,43 @@ public class AdapterManService extends OnlBaseService {
adapterGroup.setMoniuseyn(adapterGroupUI.getMoniuseyn());
}
}
public Map<String, String> reloadSyncStdMsgAndAdapter(String adapterGroupName) throws Exception {
Map<String, String> result = new HashMap<>();
String status = "success";
try {
log.debug(">>>>>>>> [Reload Start] 어댑터 그룹명 {}", adapterGroupName);
CommonCommand pcommand = new CommonCommand(
"com.eactive.eai.agent.adapter.ReloadAdapterPropGroupCommand",
adapterGroupName
);
agentUtilService.broadcast(pcommand);
CommonCommand acommand = new CommonCommand(
"com.eactive.eai.agent.adapter.ReloadAdapterGroupCommand",
adapterGroupName
);
agentUtilService.broadcast(acommand);
Command stdcommand = new ReloadSTDMessageCommand();
stdcommand.setArgs("ALL");
agentUtilService.broadcast(stdcommand);
log.info(">>>>>> [Reload End] 모든 리로드 명령 전송 완료");
} catch (Exception e) {
status = "error";
log.error("리로드 실패", e);
}
result.put("status", status);
return result;
}
public Map<String, String> reloadSync(AdapterGroupUI adapterGroupUI) throws Exception {
Map<String, Object> receive = null;
Map<String, String> result = new HashMap<>();
@@ -571,19 +587,19 @@ public class AdapterManService extends OnlBaseService {
prptyGroupName);
agentUtilService.broadcast(pcommand);
}
CommonCommand acommand = new CommonCommand("com.eactive.eai.agent.adapter.ReloadAdapterGroupCommand",
adapterGroupUI.getAdptrbzwkgroupname());
receive = agentUtilService.broadcast(acommand);
if (receive.values().stream().anyMatch(value -> value == null || !"success".equals(value))) {
status = "error";
}
result.put("status", status);
result.put("message", receive.toString());
return result;
}
public Map<String, String> deleteSync(AdapterGroupUI map, List<AdapterUI> list) throws Exception {