에러 검출 로직 수정
This commit is contained in:
@@ -39,7 +39,7 @@ public class ApiStatsMonitorImpl implements StatisticsMonitor {
|
||||
String outboundAdapter = extractOutboundAdapter(requestEaiMessage);
|
||||
long responseTimeMs = extractResponseTime(requestEaiMessage);
|
||||
boolean success = extractSuccess(requestEaiMessage);
|
||||
TransactionEvent.ErrorType errorType = extractErrorType(requestEaiMessage);
|
||||
TransactionEvent.ErrorType errorType = extractErrorType(requestEaiMessage, success);
|
||||
|
||||
// TransactionEvent 생성
|
||||
TransactionEvent event = TransactionEvent.builder().apiName(apiName).gwInstanceId(gwInstanceId)
|
||||
@@ -127,26 +127,30 @@ public class ApiStatsMonitorImpl implements StatisticsMonitor {
|
||||
* 성공 여부 추출
|
||||
*/
|
||||
private boolean extractSuccess(EAIMessage msg) {
|
||||
// logPssSno가 900이면 에러로 처리
|
||||
if (msg.getLogPssSno() == 900) {
|
||||
return false;
|
||||
}
|
||||
return msg.getStatErrorCode() == 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 에러 유형 추출
|
||||
*/
|
||||
private TransactionEvent.ErrorType extractErrorType(EAIMessage msg) {
|
||||
private TransactionEvent.ErrorType extractErrorType(EAIMessage msg, boolean success) {
|
||||
int errorCode = msg.getStatErrorCode();
|
||||
|
||||
switch (errorCode) {
|
||||
case 0:
|
||||
return null; // 정상
|
||||
return success ? null : TransactionEvent.ErrorType.SYSTEM_ERROR;
|
||||
case 1:
|
||||
return TransactionEvent.ErrorType.BUSINESS_ERROR;
|
||||
case 2:
|
||||
return TransactionEvent.ErrorType.TIMEOUT;
|
||||
case 3:
|
||||
return TransactionEvent.ErrorType.SYSTEM_ERROR;
|
||||
case 1:
|
||||
return TransactionEvent.ErrorType.BUSINESS_ERROR;
|
||||
default:
|
||||
return null;
|
||||
return success ? null : TransactionEvent.ErrorType.SYSTEM_ERROR;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user