Merge branch 'jenkins_with_weblogic' of ssh://192.168.240.178:18081/eapim/elink-online-common into jenkins_with_weblogic

This commit is contained in:
yunjy-hp
2025-12-11 11:05:48 +09:00
5 changed files with 120 additions and 5 deletions
@@ -0,0 +1,70 @@
package com.eactive.eai.inbound.action;
import com.eactive.eai.adapter.http.dynamic.impl.HttpAdapterServiceRest;
import com.eactive.eai.common.exception.ExceptionUtil;
import com.eactive.eai.common.util.MessageKeyExtractor;
/**
* 1. 기능 : Inbound Adapter를 통해 전달받은 비표준메시지에서 EAI메시지를 생성하기 위한 키값을 추출
* 2. 처리 개요 :
* - 어뎁터의 업무그룹명을 키값앞에 추가한다.
* - MessageKeyExtractor를 통해 Adapter별 추출 Rule에 따라 메시지를 구분할 수 있는 키값을 추출한다.
* 3. 주의사항
*
* @author :
* @version : v 1.0.0
* @see :
* @since :
*/
public class AdapterGroupNameMethodRequestAction extends RequestActionSupport
{
public static final String STEMSG_METHOD_DELIMITER = ":";
public static final String STEMSG_SERVICE_HEADER_DELIMITER = "^";
/**
* 1. 기능 : Inbound Adapter를 통해 전달받은 비표준메시지에서 EAI메시지를 생성하기 위한 키값을 추출
* 2. 처리 개요 :
* - MessageKeyExtractor를 통해 Adapter별 추출 Rule에 따라 메시지를 구분할 수 있는 키값을 추출한다.
* 3. 주의사항
*
* @param message Object 타입의 요청메시지
* @return String 비표준메시지의 메시지키값
* @exception
**/
public String[] perform(Object message) throws ActionException
{
byte[] tmp = null;
String key[] = null;
String adptGrpName = adapterGroupName;
String requestMethod = prop.getProperty(HttpAdapterServiceRest.PROPERTIES_NAME_HTTP_REQUEST_METHOD);
if(message instanceof byte[]) {
try {
key = MessageKeyExtractor.getMessageKeyValue(this.adapterGroupName, message);
} catch(Exception e) {
throw new ActionException(ExceptionUtil.getErrorCode(e, "RECEAIIRA001"));
}
tmp = (byte[])message;
if (logger.isInfo()) logger.info(adapterName+"] received data >> "+ new String(tmp));
} else {
try {
key = MessageKeyExtractor.getMessageKeyValue(this.adapterGroupName, message);
} catch(Exception e) {
throw new ActionException(ExceptionUtil.getErrorCode(e, "RECEAIIRA001"));
}
if (logger.isInfo()) logger.info(adapterName+"] received data >> "+ message);
}
String baseMessageKey = adptGrpName.trim() + STEMSG_METHOD_DELIMITER + requestMethod + STEMSG_SERVICE_HEADER_DELIMITER;
for(int i=0; i<key.length; i++ ) {
key[i] = baseMessageKey.trim() + key[i];
}
return key;
}
public String getDescription() {
return "키추출방식 : 어댑터그룹명:메소드^추출키값";
}
}
@@ -346,6 +346,7 @@ public class RequestProcessor extends RequestProcessorSupport {
//String eaiSvcCd = mapper.getEaiSvcCode(standardMessage); // commnet by jwhong
String eaiSvcCd = prop.getProperty("API_SERVICE_CODE");
System.out.println("***** eaiSvcCd is"+ eaiSvcCd);
if (StringUtils.isEmpty(eaiSvcCd)) eaiSvcCd = mapper.getEaiSvcCode(standardMessage); // HTT 어댑터로 들어오는거래는 Prop에 서비스코드가 없음.
String guid = mapper.getGuid(standardMessage);
String guidSeq = mapper.getGuidSeq(standardMessage);
String returnType = mapper.getSendRecvDivision(standardMessage); // S|R