롤링배포를 위한 healthCheck 추가,

기존 eai/fep healthCheck와 동일.
This commit is contained in:
cho
2026-03-05 14:01:36 +09:00
parent 35579fefb7
commit 1c5d67d486
2 changed files with 90 additions and 1 deletions
@@ -24,4 +24,9 @@ use.internal.queue=false
# sync-async mapping
use.internal.topic=true
# restore mapping
use.cache.store=true
use.cache.store=true
#healthCheck.jsp
CHECK_PATH=/App/{serverType}/chkfile
CHECK_FILE=healthCheckFalse
+84
View File
@@ -0,0 +1,84 @@
<%@ page language="java" contentType="text/html; charset=EUC-KR"%>
<%@ page import="java.io.*, java.util.*"%>
<%!private boolean fileCheck(String path, String fileName) throws Exception {
String name = System.getProperty("inst.Name");
File file = new File(path + File.separator + name + File.separator + fileName);
if (file.exists()) {
return false;
} else {
return true;
}
}
private String replaceServiceType(String data) {
String name = System.getProperty("inst.Name");
String serverType = name.substring(0, 3);
return data.replaceAll("\\$\\{serverType\\}", serverType);
}
private Properties getLoad(String path) {
Properties prop = new Properties();
InputStream input = null;
try {
input = new FileInputStream(path);
prop.load(input);
return prop;
} catch (Exception e) {
e.printStackTrace();
} finally {
if (input != null) {
try {
input.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return prop;
}%>
<%
response.setHeader("Pragma", "No-cache");
response.setHeader("Cache-Control", "no-cache");
response.setHeader("Expires", "0");
ClassLoader clsLoader = Thread.currentThread().getContextClassLoader();
InputStream input = clsLoader.getResourceAsStream("env.common.properties");
Properties props = new Properties();
props.load(input);
String path = props.getProperty("CHECK_PATH");
String fileName = props.getProperty("CHECK_FILE");
String path2 = replaceServiceType(path);
%>
<html>
<body>
<pre>
prop:CHECK_PATH=<%=path%><br>
prop:CHECK_FILE=<%=fileName%><br>
replace servicType=<%=path2%><br>
<%
if( !fileCheck(path2,fileName) ){
%>
status=500
<%
response.setStatus(500);
} else {
%>
status=200
<%
response.setStatus(200);
}
%>
</pre>
</body>
</html>