Compare commits
7 Commits
2829d4362c
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
| c118c88dce | |||
| 28a4becf1c | |||
| 8339efc752 | |||
| 61c9aa9864 | |||
| a515d0f8b0 | |||
| b389ef2962 | |||
| c15e52d205 |
@@ -57,7 +57,7 @@ public class HttpStatusException extends Exception {
|
|||||||
|
|
||||||
public String getCode() {
|
public String getCode() {
|
||||||
if (StringUtils.isBlank(code)) {
|
if (StringUtils.isBlank(code)) {
|
||||||
return String.format("Http Status: %d", status);
|
return String.format("HttCd:%d", status);
|
||||||
} else {
|
} else {
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|||||||
+23
-3
@@ -11,7 +11,9 @@ import java.security.KeyStoreException;
|
|||||||
import java.security.NoSuchAlgorithmException;
|
import java.security.NoSuchAlgorithmException;
|
||||||
import java.security.UnrecoverableKeyException;
|
import java.security.UnrecoverableKeyException;
|
||||||
import java.security.cert.CertificateException;
|
import java.security.cert.CertificateException;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
@@ -30,6 +32,7 @@ import org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManagerBuil
|
|||||||
import org.apache.hc.client5.http.ssl.NoopHostnameVerifier;
|
import org.apache.hc.client5.http.ssl.NoopHostnameVerifier;
|
||||||
import org.apache.hc.client5.http.ssl.SSLConnectionSocketFactory;
|
import org.apache.hc.client5.http.ssl.SSLConnectionSocketFactory;
|
||||||
import org.apache.hc.client5.http.ssl.TrustAllStrategy;
|
import org.apache.hc.client5.http.ssl.TrustAllStrategy;
|
||||||
|
import org.apache.hc.core5.http.Header;
|
||||||
import org.apache.hc.core5.http.HttpRequest;
|
import org.apache.hc.core5.http.HttpRequest;
|
||||||
import org.apache.hc.core5.http.HttpRequestInterceptor;
|
import org.apache.hc.core5.http.HttpRequestInterceptor;
|
||||||
import org.apache.hc.core5.http.HttpResponseInterceptor;
|
import org.apache.hc.core5.http.HttpResponseInterceptor;
|
||||||
@@ -40,6 +43,7 @@ import com.eactive.eai.adapter.AdapterManager;
|
|||||||
import com.eactive.eai.adapter.Keys;
|
import com.eactive.eai.adapter.Keys;
|
||||||
import com.eactive.eai.adapter.http.secure.HttpClient5SSLContextFactory;
|
import com.eactive.eai.adapter.http.secure.HttpClient5SSLContextFactory;
|
||||||
import com.eactive.eai.common.TransactionContextKeys;
|
import com.eactive.eai.common.TransactionContextKeys;
|
||||||
|
import com.eactive.eai.common.logger.HttpAdapterExtraHeaderVo;
|
||||||
import com.eactive.eai.common.message.EAIMessageKeys;
|
import com.eactive.eai.common.message.EAIMessageKeys;
|
||||||
import com.eactive.eai.common.property.PropManager;
|
import com.eactive.eai.common.property.PropManager;
|
||||||
import com.eactive.eai.common.server.EAIServerManager;
|
import com.eactive.eai.common.server.EAIServerManager;
|
||||||
@@ -416,8 +420,24 @@ public abstract class HttpClient5AdapterServiceSupport implements HttpClientAdap
|
|||||||
logProcessNo = 200;
|
logProcessNo = 200;
|
||||||
}
|
}
|
||||||
|
|
||||||
HttpAdapterExtraLogUtil.insertHttpAdapterExtraLog(uuid, logProcessNo,
|
Header[] headers = request.getHeaders();
|
||||||
contextAdapterGroupName, contextAdapterName, request.getHeaders(), url, request.getMethod());
|
List<HttpAdapterExtraHeaderVo> headerVoList = null;
|
||||||
|
if ( headers != null && headers.length != 0 ) {
|
||||||
|
headerVoList = HttpAdapterExtraLogUtil.convertHeaderToListOfHttpAdapterExtraHeaderVo(headers);
|
||||||
|
} else {
|
||||||
|
headerVoList = new ArrayList<HttpAdapterExtraHeaderVo>();
|
||||||
|
}
|
||||||
|
|
||||||
|
String trimedPostBody = (String) context.getAttribute(HttpAdapterExtraLogUtil.BODY_FIELD_NAME);
|
||||||
|
if(StringUtils.isNotEmpty(trimedPostBody)) {
|
||||||
|
HttpAdapterExtraHeaderVo vo = new HttpAdapterExtraHeaderVo();
|
||||||
|
vo.setName(HttpAdapterExtraLogUtil.BODY_FIELD_NAME);
|
||||||
|
vo.setValue(trimedPostBody);
|
||||||
|
headerVoList.add(vo);
|
||||||
|
}
|
||||||
|
|
||||||
|
HttpAdapterExtraLogUtil.insertHttpAdapterExtraLog(uuid, logProcessNo,
|
||||||
|
contextAdapterGroupName, contextAdapterName, headerVoList, url, request.getMethod(), 0);
|
||||||
} catch (URISyntaxException e) {
|
} catch (URISyntaxException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
@@ -443,7 +463,7 @@ public abstract class HttpClient5AdapterServiceSupport implements HttpClientAdap
|
|||||||
}else{
|
}else{
|
||||||
logProcessNo += 100;
|
logProcessNo += 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
HttpAdapterExtraLogUtil.insertHttpAdapterExtraLog(uuid, logProcessNo,
|
HttpAdapterExtraLogUtil.insertHttpAdapterExtraLog(uuid, logProcessNo,
|
||||||
contextAdapterGroupName, contextAdapterName, response.getHeaders(), url, request.getMethod(), response.getCode());
|
contextAdapterGroupName, contextAdapterName, response.getHeaders(), url, request.getMethod(), response.getCode());
|
||||||
} catch (URISyntaxException e) {
|
} catch (URISyntaxException e) {
|
||||||
|
|||||||
+8
-8
@@ -88,10 +88,17 @@ public class DeadlineAwareRetryExecutor {
|
|||||||
|
|
||||||
if (!policy.shouldRetryOnStatus(request, status)) {
|
if (!policy.shouldRetryOnStatus(request, status)) {
|
||||||
// 성공 또는 재시도 불필요 → 호출부에서 close 책임
|
// 성공 또는 재시도 불필요 → 호출부에서 close 책임
|
||||||
log.debug("non-retryable response status={}, attempt={}", status, attempt + 1);
|
log.info("non-retryable response status={}, attempt={}", status, attempt + 1);
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ④ 마지막 시도였으면 종료
|
||||||
|
if (attempt >= policy.getMaxRetries()) {
|
||||||
|
// 최대 재처리에 도달하여, 재시도하지 않고, 응답 객체를 리턴한다.
|
||||||
|
log.info("최대 재시도 횟수 도달 response status={}, attempt={}", status, attempt + 1);
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
// 재시도 대상
|
// 재시도 대상
|
||||||
log.warn("retryable status={}, attempt={}/{}",
|
log.warn("retryable status={}, attempt={}/{}",
|
||||||
status, attempt + 1, policy.getMaxRetries());
|
status, attempt + 1, policy.getMaxRetries());
|
||||||
@@ -127,9 +134,6 @@ public class DeadlineAwareRetryExecutor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ④ 마지막 시도였으면 바로 종료
|
|
||||||
if (attempt >= policy.getMaxRetries()) break;
|
|
||||||
|
|
||||||
// ⑤ 백오프 대기 전 남은 시간 재확인
|
// ⑤ 백오프 대기 전 남은 시간 재확인
|
||||||
long remainingBeforeWait = totalDeadlineMs - (System.currentTimeMillis() - startTime);
|
long remainingBeforeWait = totalDeadlineMs - (System.currentTimeMillis() - startTime);
|
||||||
if (remainingBeforeWait <= policy.getBackoffMs()) {
|
if (remainingBeforeWait <= policy.getBackoffMs()) {
|
||||||
@@ -171,10 +175,6 @@ public class DeadlineAwareRetryExecutor {
|
|||||||
log.info("RequestConfig = {}", config);
|
log.info("RequestConfig = {}", config);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isSuccess(int status) {
|
|
||||||
return status >= 200 && status < 300;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void closeQuietly(CloseableHttpResponse response) {
|
private void closeQuietly(CloseableHttpResponse response) {
|
||||||
try {
|
try {
|
||||||
response.close();
|
response.close();
|
||||||
|
|||||||
+10
-1
@@ -14,6 +14,7 @@ import org.apache.commons.lang3.StringUtils;
|
|||||||
import org.apache.commons.lang3.time.StopWatch;
|
import org.apache.commons.lang3.time.StopWatch;
|
||||||
import org.apache.hc.client5.http.classic.methods.HttpPost;
|
import org.apache.hc.client5.http.classic.methods.HttpPost;
|
||||||
import org.apache.hc.client5.http.config.RequestConfig;
|
import org.apache.hc.client5.http.config.RequestConfig;
|
||||||
|
import org.apache.hc.client5.http.impl.classic.CloseableHttpClient;
|
||||||
import org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;
|
import org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;
|
||||||
import org.apache.hc.core5.http.ContentType;
|
import org.apache.hc.core5.http.ContentType;
|
||||||
import org.apache.hc.core5.http.HttpHost;
|
import org.apache.hc.core5.http.HttpHost;
|
||||||
@@ -135,7 +136,15 @@ public class HttpClient5AdapterServiceBody extends HttpClient5AdapterServiceSupp
|
|||||||
|
|
||||||
byte[] responseMessage = null;
|
byte[] responseMessage = null;
|
||||||
String responseString = "";
|
String responseString = "";
|
||||||
try (CloseableHttpResponse response = (CloseableHttpResponse) this.client.execute(method, context)) {
|
|
||||||
|
DeadlineAwareRetryExecutor executor =
|
||||||
|
new DeadlineAwareRetryExecutor((CloseableHttpClient)this.client,
|
||||||
|
vo.getConnectionTimeout(),
|
||||||
|
vo.getTimeout());
|
||||||
|
|
||||||
|
// Properties에서 RetryPolicy 로드
|
||||||
|
RetryPolicy policy = RetryPolicy.from(prop); // 설정 로드 방식에 맞게
|
||||||
|
try (CloseableHttpResponse response = (CloseableHttpResponse) executor.execute(method, context, policy)) {
|
||||||
status = response.getCode();
|
status = response.getCode();
|
||||||
responseMessage = EntityUtils.toByteArray(response.getEntity());
|
responseMessage = EntityUtils.toByteArray(response.getEntity());
|
||||||
responseString = new String(responseMessage, vo.getEncode());
|
responseString = new String(responseMessage, vo.getEncode());
|
||||||
|
|||||||
+12
-1
@@ -66,7 +66,9 @@ import com.eactive.eai.common.exception.ExceptionUtil;
|
|||||||
import com.eactive.eai.common.message.MessageType;
|
import com.eactive.eai.common.message.MessageType;
|
||||||
import com.eactive.eai.common.property.PropManager;
|
import com.eactive.eai.common.property.PropManager;
|
||||||
import com.eactive.eai.common.util.CommonLib;
|
import com.eactive.eai.common.util.CommonLib;
|
||||||
|
import com.eactive.eai.common.util.HttpAdapterExtraLogUtil;
|
||||||
import com.eactive.eai.common.util.JacksonUtil;
|
import com.eactive.eai.common.util.JacksonUtil;
|
||||||
|
import com.eactive.eai.common.util.RestSendBodyLogUtils;
|
||||||
import com.eactive.eai.common.util.TxFileLogger;
|
import com.eactive.eai.common.util.TxFileLogger;
|
||||||
import com.eactive.eai.common.util.XMLUtils;
|
import com.eactive.eai.common.util.XMLUtils;
|
||||||
import com.eactive.eai.util.JsonPathUtil;
|
import com.eactive.eai.util.JsonPathUtil;
|
||||||
@@ -363,6 +365,8 @@ public class HttpClient5AdapterServiceRest extends HttpClient5AdapterServiceSupp
|
|||||||
|
|
||||||
configureHttpClient(requestConfigBuilder, vo, method);
|
configureHttpClient(requestConfigBuilder, vo, method);
|
||||||
assignFilterHeaders(method, tempProp); // OutBound PreFilter에서 설정한 Header내용 설정.
|
assignFilterHeaders(method, tempProp); // OutBound PreFilter에서 설정한 Header내용 설정.
|
||||||
|
|
||||||
|
String postBody = "";
|
||||||
|
|
||||||
switch (HttpMethodType.getValue(rmethod)) {
|
switch (HttpMethodType.getValue(rmethod)) {
|
||||||
case GET:
|
case GET:
|
||||||
@@ -376,7 +380,7 @@ public class HttpClient5AdapterServiceRest extends HttpClient5AdapterServiceSupp
|
|||||||
//assignPostBody(dataContent, contentType, vo.getEncode(), method); // jwhong commnet
|
//assignPostBody(dataContent, contentType, vo.getEncode(), method); // jwhong commnet
|
||||||
// KJBank API 추적정보를 Header에 제공. jwhong
|
// KJBank API 추적정보를 Header에 제공. jwhong
|
||||||
// String inboundToken= assignRequestKJHeaders(method, prop, tempProp );
|
// String inboundToken= assignRequestKJHeaders(method, prop, tempProp );
|
||||||
assignPostBody(dataObject, mimeType, charset, method, chunked);
|
postBody = assignPostBody(dataObject, mimeType, charset, method, chunked);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -435,6 +439,11 @@ public class HttpClient5AdapterServiceRest extends HttpClient5AdapterServiceSupp
|
|||||||
if (logProcessNo != null && logProcessNo > 0) {
|
if (logProcessNo != null && logProcessNo > 0) {
|
||||||
context.setAttribute(HttpClientAdapterServiceKey.LOG_PROCESS_NO, logProcessNo);
|
context.setAttribute(HttpClientAdapterServiceKey.LOG_PROCESS_NO, logProcessNo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (RestSendBodyLogUtils.isBodyLoggingApi(tempProp.getProperty("API_SERVICE_CODE"))) {
|
||||||
|
String trimmedBody = RestSendBodyLogUtils.getBodyByMaxSize(postBody);
|
||||||
|
context.setAttribute(HttpAdapterExtraLogUtil.BODY_FIELD_NAME, trimmedBody);
|
||||||
|
}
|
||||||
|
|
||||||
// encrypt algorithm type 추출 from adapter property jwhong
|
// encrypt algorithm type 추출 from adapter property jwhong
|
||||||
// Properties properties = AdapterPropManager.getInstance().getProperties(vo.getAdapterName()); // jwhong
|
// Properties properties = AdapterPropManager.getInstance().getProperties(vo.getAdapterName()); // jwhong
|
||||||
@@ -859,6 +868,8 @@ public class HttpClient5AdapterServiceRest extends HttpClient5AdapterServiceSupp
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void setAuthHeaders(HttpUriRequestBase method, String authorization, String authorizationHeaderName) throws Exception {
|
protected void setAuthHeaders(HttpUriRequestBase method, String authorization, String authorizationHeaderName) throws Exception {
|
||||||
|
if(StringUtils.isEmpty(authorizationHeaderName))
|
||||||
|
authorizationHeaderName = "Authorization";
|
||||||
method.setHeader(authorizationHeaderName,
|
method.setHeader(authorizationHeaderName,
|
||||||
String.format("%s", authorization));
|
String.format("%s", authorization));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ public class RetryPolicy {
|
|||||||
|
|
||||||
return new RetryPolicy(getInt(props, RETRY_MAX_RETRIES, 0), getLong(props, RETRY_BACKOFF_MS, 1000L), codes,
|
return new RetryPolicy(getInt(props, RETRY_MAX_RETRIES, 0), getLong(props, RETRY_BACKOFF_MS, 1000L), codes,
|
||||||
getBoolean(props, RETRY_ON_CONNECT_FAIL, false), getBoolean(props, RETRY_ON_TIMEOUT, false),
|
getBoolean(props, RETRY_ON_CONNECT_FAIL, false), getBoolean(props, RETRY_ON_TIMEOUT, false),
|
||||||
getBoolean(props, RETRY_IDEMPOTENT_ONLY, true));
|
getBoolean(props, RETRY_IDEMPOTENT_ONLY, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------
|
// ----------------------------------------------------------------
|
||||||
|
|||||||
+33
@@ -0,0 +1,33 @@
|
|||||||
|
package com.eactive.eai.adapter.http.client.impl.filter;
|
||||||
|
|
||||||
|
import java.util.Properties;
|
||||||
|
|
||||||
|
import com.eactive.eai.adapter.http.dynamic.HttpAdapterServiceKey;
|
||||||
|
import com.eactive.eai.common.util.Logger;
|
||||||
|
|
||||||
|
public class DebugLoggerOutFilter implements HttpClientAdapterFilter, HttpAdapterServiceKey {
|
||||||
|
protected static Logger logger = Logger.getLogger(Logger.LOGGER_ADAPTER);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object doPreFilter(String adptGrpName, String adptName, Properties prop, Object message, Properties tempProp)
|
||||||
|
throws Exception {
|
||||||
|
logger.debug("Outbound Filter SND adptGrpName : {}", adptGrpName);
|
||||||
|
logger.debug("Outbound Filter SND adptName : {}", adptName);
|
||||||
|
logger.debug("Outbound Filter SND prop : {}", prop);
|
||||||
|
logger.debug("Outbound Filter SND message : {}", message);
|
||||||
|
logger.debug("Outbound Filter SND tempProp : {}", tempProp);
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object doPostFilter(String adptGrpName, String adptName, Properties prop, Object message,
|
||||||
|
Properties tempProp) throws Exception {
|
||||||
|
logger.debug("Outbound Filter RCV adptGrpName : {}", adptGrpName);
|
||||||
|
logger.debug("Outbound Filter RCV adptName : {}", adptName);
|
||||||
|
logger.debug("Outbound Filter RCV prop : {}", prop);
|
||||||
|
logger.debug("Outbound Filter RCV message : {}", message);
|
||||||
|
logger.debug("Outbound Filter RCV tempProp : {}", tempProp);
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -85,4 +85,8 @@ public interface HttpAdapterServiceKey {
|
|||||||
|
|
||||||
//응답 처리 용 표준 전문 오브젝트
|
//응답 처리 용 표준 전문 오브젝트
|
||||||
static final String STANDARD_MESSAGE_OBJECT = "STANDARD_MESSAGE_OBJECT";
|
static final String STANDARD_MESSAGE_OBJECT = "STANDARD_MESSAGE_OBJECT";
|
||||||
|
|
||||||
|
// 어댑터별 인증 키 헤더 이름
|
||||||
|
static final String ADAPTER_TOKEN_HEADER_NAME = "ADAPTER_TOKEN_HEADER_NAME";
|
||||||
|
static final String ADAPTER_APIKEY_HEADER_NAME = "ADAPTER_APIKEY_HEADER_NAME";
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -22,10 +22,10 @@ import com.eactive.eai.inbound.error.InboundErrorInfoVO;
|
|||||||
import com.eactive.eai.inbound.error.InboundErrorKeys;
|
import com.eactive.eai.inbound.error.InboundErrorKeys;
|
||||||
import com.eactive.eai.util.HexaConverter;
|
import com.eactive.eai.util.HexaConverter;
|
||||||
|
|
||||||
public class UnkownMessageLogUtils {
|
public class UnknownMessageLogUtils {
|
||||||
static Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
|
static Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
|
||||||
|
|
||||||
private UnkownMessageLogUtils() {
|
private UnknownMessageLogUtils() {
|
||||||
throw new IllegalStateException("Utility class");
|
throw new IllegalStateException("Utility class");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -49,7 +49,7 @@ public class UnkownMessageLogUtils {
|
|||||||
StringBuffer sb = new StringBuffer();
|
StringBuffer sb = new StringBuffer();
|
||||||
sb.append(errorMsg).append("\n").append("Remote Addr : ").append(request.getRemoteAddr()).append("\n").append("Request URI : ")
|
sb.append(errorMsg).append("\n").append("Remote Addr : ").append(request.getRemoteAddr()).append("\n").append("Request URI : ")
|
||||||
.append(request.getRequestURI()).append("\n").append("clientId=").append(clientId).append(",hexClientId=").append(hexClientId).append(",txProp=").append(prop).append("\n").append("Exception : ").append(e.getMessage());
|
.append(request.getRequestURI()).append("\n").append("clientId=").append(clientId).append(",hexClientId=").append(hexClientId).append(",txProp=").append(prop).append("\n").append("Exception : ").append(e.getMessage());
|
||||||
UnkownMessageLogUtils.logUnknownMessage(txId, adptGrpName, adptName,
|
UnknownMessageLogUtils.logUnknownMessage(txId, adptGrpName, adptName,
|
||||||
"", "", false, errCode, sb.toString(), System.currentTimeMillis(),
|
"", "", false, errCode, sb.toString(), System.currentTimeMillis(),
|
||||||
serverName, InboundErrorKeys.IN_UNKNOWN, message);
|
serverName, InboundErrorKeys.IN_UNKNOWN, message);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
@@ -1,5 +1,26 @@
|
|||||||
package com.eactive.eai.adapter.http.dynamic.filter;
|
package com.eactive.eai.adapter.http.dynamic.filter;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.security.KeyFactory;
|
||||||
|
import java.security.NoSuchAlgorithmException;
|
||||||
|
import java.security.interfaces.RSAPublicKey;
|
||||||
|
import java.security.spec.InvalidKeySpecException;
|
||||||
|
import java.security.spec.X509EncodedKeySpec;
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.util.Base64;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Properties;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.core.io.ClassPathResource;
|
||||||
|
import org.springframework.core.io.Resource;
|
||||||
|
|
||||||
|
import com.eactive.eai.adapter.http.dynamic.HttpAdapterServiceKey;
|
||||||
import com.eactive.eai.adapter.http.dynamic.HttpAdapterServiceSupport;
|
import com.eactive.eai.adapter.http.dynamic.HttpAdapterServiceSupport;
|
||||||
import com.eactive.eai.authserver.service.BearerTokenInfo;
|
import com.eactive.eai.authserver.service.BearerTokenInfo;
|
||||||
//import com.eactive.eai.authserver.vo.BearerTokenInfo;
|
//import com.eactive.eai.authserver.vo.BearerTokenInfo;
|
||||||
@@ -13,7 +34,6 @@ import com.eactive.eai.common.property.PropManager;
|
|||||||
import com.eactive.eai.common.session.SessionManager;
|
import com.eactive.eai.common.session.SessionManager;
|
||||||
import com.eactive.eai.common.stdmessage.STDMessageManager;
|
import com.eactive.eai.common.stdmessage.STDMessageManager;
|
||||||
import com.eactive.eai.common.util.Logger;
|
import com.eactive.eai.common.util.Logger;
|
||||||
import com.eactive.eai.common.util.StringUtil;
|
|
||||||
import com.eactive.eai.inbound.action.ActionFactory;
|
import com.eactive.eai.inbound.action.ActionFactory;
|
||||||
import com.eactive.eai.inbound.action.RequestAction;
|
import com.eactive.eai.inbound.action.RequestAction;
|
||||||
import com.eactive.eai.inbound.processor.Processor;
|
import com.eactive.eai.inbound.processor.Processor;
|
||||||
@@ -25,27 +45,6 @@ import com.nimbusds.jose.crypto.RSASSAVerifier;
|
|||||||
import com.nimbusds.jose.util.IOUtils;
|
import com.nimbusds.jose.util.IOUtils;
|
||||||
import com.nimbusds.jwt.SignedJWT;
|
import com.nimbusds.jwt.SignedJWT;
|
||||||
|
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.springframework.core.io.ClassPathResource;
|
|
||||||
import org.springframework.core.io.Resource;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.security.KeyFactory;
|
|
||||||
import java.security.NoSuchAlgorithmException;
|
|
||||||
import java.security.interfaces.RSAPublicKey;
|
|
||||||
import java.security.spec.InvalidKeySpecException;
|
|
||||||
import java.security.spec.X509EncodedKeySpec;
|
|
||||||
import java.text.ParseException;
|
|
||||||
import java.util.Base64;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Properties;
|
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
|
||||||
|
|
||||||
public class ApiAuthFilter implements HttpAdapterFilter {
|
public class ApiAuthFilter implements HttpAdapterFilter {
|
||||||
static Logger logger = Logger.getLogger(Logger.LOGGER_ADAPTER);
|
static Logger logger = Logger.getLogger(Logger.LOGGER_ADAPTER);
|
||||||
|
|
||||||
@@ -124,7 +123,7 @@ public class ApiAuthFilter implements HttpAdapterFilter {
|
|||||||
switch (eaiMessage.getAuthType()){
|
switch (eaiMessage.getAuthType()){
|
||||||
case "oauth":
|
case "oauth":
|
||||||
try {
|
try {
|
||||||
String token = extractBearerToken(request);
|
String token = extractBearerToken(request, prop);
|
||||||
SignedJWT signedJWT = SignedJWT.parse(token);
|
SignedJWT signedJWT = SignedJWT.parse(token);
|
||||||
|
|
||||||
if (signedJWT.getJWTClaimsSet().getExpirationTime() == null) {
|
if (signedJWT.getJWTClaimsSet().getExpirationTime() == null) {
|
||||||
@@ -182,8 +181,23 @@ public class ApiAuthFilter implements HttpAdapterFilter {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "api_key":
|
case "api_key":
|
||||||
String apiKeyName = PropManager.getInstance().getProperty("ApiConfig", "api.key.name", "x-api-key");
|
// 기관별로 API Key 헤더명이 다를 수 있어, 어댑터별 설정(ADAPTER_TOKEN_HEADER_NAME)을 우선 사용하고
|
||||||
String apiKey = request.getHeader(apiKeyName);
|
// 없으면 ApiConfig 전역 설정(api.key.name)을 사용. 콤마로 다중 헤더명 지정 시 순서대로 값이 있는 헤더를 사용
|
||||||
|
String apiKeyNameConf = prop.getProperty(HttpAdapterServiceKey.ADAPTER_APIKEY_HEADER_NAME);
|
||||||
|
if (StringUtils.isBlank(apiKeyNameConf)) {
|
||||||
|
apiKeyNameConf = PropManager.getInstance().getProperty("ApiConfig", "api.key.name", "x-api-key");
|
||||||
|
}
|
||||||
|
String[] apiKeyNames = org.springframework.util.StringUtils.tokenizeToStringArray(apiKeyNameConf, ",");
|
||||||
|
String apiKeyName = null;
|
||||||
|
String apiKey = null;
|
||||||
|
for (String name : apiKeyNames) {
|
||||||
|
String value = request.getHeader(name);
|
||||||
|
if (StringUtils.isNotBlank(value)) {
|
||||||
|
apiKeyName = name;
|
||||||
|
apiKey = value.trim();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
if(apiKey == null){
|
if(apiKey == null){
|
||||||
// QueryString으로 전달된 access_token 파라미터 확인
|
// QueryString으로 전달된 access_token 파라미터 확인
|
||||||
String apiKeyParamName = PropManager.getInstance().getProperty("ApiConfig", "api.key.param.name", "x-api-key");
|
String apiKeyParamName = PropManager.getInstance().getProperty("ApiConfig", "api.key.param.name", "x-api-key");
|
||||||
@@ -191,14 +205,14 @@ public class ApiAuthFilter implements HttpAdapterFilter {
|
|||||||
if (StringUtils.isNotBlank(queryApiKey)) {
|
if (StringUtils.isNotBlank(queryApiKey)) {
|
||||||
apiKey = queryApiKey.trim();
|
apiKey = queryApiKey.trim();
|
||||||
} else {
|
} else {
|
||||||
throw new JwtAuthException(ERROR_AUTHENTICATION_FAIL, "Invalid or missing API key \""+apiKeyName+"\" in Http Header");
|
throw new JwtAuthException(ERROR_AUTHENTICATION_FAIL, "Invalid or missing API key \""+apiKeyNameConf+"\" in Http Header");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
prop.setProperty(HttpAdapterServiceSupport.PROPERTIES_NAME_CLIENT_ID, apiKey);
|
prop.setProperty(HttpAdapterServiceSupport.PROPERTIES_NAME_CLIENT_ID, apiKey);
|
||||||
isPassScope = true;
|
isPassScope = true;
|
||||||
break;
|
break;
|
||||||
case "ca":
|
case "ca":
|
||||||
String token = extractBearerToken(request);
|
String token = extractBearerToken(request, prop);
|
||||||
BearerTokenInfo bearerTokenInfo = SessionManager.getInstance().getCAToken(token);
|
BearerTokenInfo bearerTokenInfo = SessionManager.getInstance().getCAToken(token);
|
||||||
if ( bearerTokenInfo != null ) {
|
if ( bearerTokenInfo != null ) {
|
||||||
if( bearerTokenInfo.isExpired() ) {
|
if( bearerTokenInfo.isExpired() ) {
|
||||||
@@ -319,8 +333,13 @@ public class ApiAuthFilter implements HttpAdapterFilter {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String extractBearerToken(HttpServletRequest request) throws JwtAuthException {
|
public static String extractBearerToken(HttpServletRequest request, Properties prop) throws JwtAuthException {
|
||||||
String tokenHeaderName = PropManager.getInstance().getProperty("ApiConfig", "token.header.name", "Authorization");
|
// 기관별로 토큰 헤더명이 다를 수 있어, 어댑터별 설정(ADAPTER_APPKEY_HEADER_NAME)을 우선 사용하고
|
||||||
|
// 없으면 ApiConfig 전역 설정(token.header.name)을 사용
|
||||||
|
String tokenHeaderName = prop != null ? prop.getProperty(HttpAdapterServiceKey.ADAPTER_TOKEN_HEADER_NAME) : null;
|
||||||
|
if (StringUtils.isBlank(tokenHeaderName)) {
|
||||||
|
tokenHeaderName = PropManager.getInstance().getProperty("ApiConfig", "token.header.name", "Authorization");
|
||||||
|
}
|
||||||
String authorization = request.getHeader(tokenHeaderName);
|
String authorization = request.getHeader(tokenHeaderName);
|
||||||
if (StringUtils.isBlank(authorization)) {
|
if (StringUtils.isBlank(authorization)) {
|
||||||
// QueryString으로 전달된 access_token 파라미터 확인
|
// QueryString으로 전달된 access_token 파라미터 확인
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.eactive.eai.adapter.http.dynamic.filter;
|
||||||
|
|
||||||
|
import java.util.Properties;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.eactive.eai.common.util.Logger;
|
||||||
|
|
||||||
|
public class DebugLoggerInFilter implements HttpAdapterFilter {
|
||||||
|
protected static Logger logger = Logger.getLogger(Logger.LOGGER_ADAPTER);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object doPreFilter(String adptGrpName, String adptName, Object message, Properties prop,
|
||||||
|
HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||||
|
logger.debug("Inbound Filter RCV adptGrpName : {}", adptGrpName);
|
||||||
|
logger.debug("Inbound Filter RCV adptName : {}", adptName);
|
||||||
|
logger.debug("Inbound Filter RCV message : {}", message);
|
||||||
|
logger.debug("Inbound Filter RCV prop : {}", prop);
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object doPostFilter(String adptGrpName, String adptName, Object resultMessage, Properties prop,
|
||||||
|
HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||||
|
logger.debug("Inbound Filter SND adptGrpName : {}", adptGrpName);
|
||||||
|
logger.debug("Inbound Filter SND adptName : {}", adptName);
|
||||||
|
logger.debug("Inbound Filter SND resultMessage : {}", resultMessage);
|
||||||
|
logger.debug("Inbound Filter SND prop : {}", prop);
|
||||||
|
return resultMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+3
-3
@@ -31,7 +31,7 @@ import com.eactive.eai.adapter.http.HttpMemoryLogger;
|
|||||||
import com.eactive.eai.adapter.http.HttpStatusException;
|
import com.eactive.eai.adapter.http.HttpStatusException;
|
||||||
import com.eactive.eai.adapter.http.client.HttpClientAdapterServiceKey;
|
import com.eactive.eai.adapter.http.client.HttpClientAdapterServiceKey;
|
||||||
import com.eactive.eai.adapter.http.dynamic.HttpAdapterServiceSupport;
|
import com.eactive.eai.adapter.http.dynamic.HttpAdapterServiceSupport;
|
||||||
import com.eactive.eai.adapter.http.dynamic.UnkownMessageLogUtils;
|
import com.eactive.eai.adapter.http.dynamic.UnknownMessageLogUtils;
|
||||||
import com.eactive.eai.common.TransactionContextKeys;
|
import com.eactive.eai.common.TransactionContextKeys;
|
||||||
import com.eactive.eai.common.exception.ExceptionUtil;
|
import com.eactive.eai.common.exception.ExceptionUtil;
|
||||||
import com.eactive.eai.common.util.CommonLib;
|
import com.eactive.eai.common.util.CommonLib;
|
||||||
@@ -341,10 +341,10 @@ public class HttpAdapterServiceStandard extends HttpAdapterServiceSupport
|
|||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
try {
|
try {
|
||||||
UnkownMessageLogUtils.logUnkownMessage(adptGrpName, adptName, requestBytes != null ? new String(requestBytes, encode) : null, prop, request, response,
|
UnknownMessageLogUtils.logUnkownMessage(adptGrpName, adptName, requestBytes != null ? new String(requestBytes, encode) : null, prop, request, response,
|
||||||
"RECEAIIRP202", e);
|
"RECEAIIRP202", e);
|
||||||
} catch (UnsupportedEncodingException e1) {
|
} catch (UnsupportedEncodingException e1) {
|
||||||
UnkownMessageLogUtils.logUnkownMessage(adptGrpName, adptName, requestBytes != null ? new String(requestBytes) : null, prop, request, response,
|
UnknownMessageLogUtils.logUnkownMessage(adptGrpName, adptName, requestBytes != null ? new String(requestBytes) : null, prop, request, response,
|
||||||
"RECEAIIRP202", e);
|
"RECEAIIRP202", e);
|
||||||
}
|
}
|
||||||
if (traceLevel >= 3){
|
if (traceLevel >= 3){
|
||||||
|
|||||||
@@ -104,8 +104,9 @@ public class InflowControlDAO extends BaseDAO {
|
|||||||
for (InflowControl inflowControl : inflowControls) {
|
for (InflowControl inflowControl : inflowControls) {
|
||||||
InflowTargetVO vo = new InflowTargetVO();
|
InflowTargetVO vo = new InflowTargetVO();
|
||||||
vo.setName(inflowControl.getId().getName());
|
vo.setName(inflowControl.getId().getName());
|
||||||
vo.setThreshold(inflowControl.getThreshold());
|
vo.setThreshold(inflowControl.getThreshold() == null ? 0 : inflowControl.getThreshold());
|
||||||
vo.setThresholdPerSecond(inflowControl.getThresholdpersecond());
|
vo.setThresholdPerSecond(
|
||||||
|
inflowControl.getThresholdpersecond() == null ? 0 : inflowControl.getThresholdpersecond());
|
||||||
vo.setThresholdTimeUnit(inflowControl.getThresholdtimeunit());
|
vo.setThresholdTimeUnit(inflowControl.getThresholdtimeunit());
|
||||||
vo.setActivate(!"0".equals(inflowControl.getUseyn()));
|
vo.setActivate(!"0".equals(inflowControl.getUseyn()));
|
||||||
targetList.put(vo.getName(), vo);
|
targetList.put(vo.getName(), vo);
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.eactive.eai.common.logger;
|
package com.eactive.eai.common.logger;
|
||||||
|
|
||||||
import com.eactive.eai.common.logger.mapper.HttpAdapterExtraLogMapper;
|
import com.eactive.eai.common.logger.mapper.HttpAdapterExtraLogMapper;
|
||||||
|
import com.eactive.eai.common.util.Logger;
|
||||||
import com.eactive.eai.data.entity.onl.logger.HttpAdapterExtraLog;
|
import com.eactive.eai.data.entity.onl.logger.HttpAdapterExtraLog;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -10,7 +11,9 @@ import org.springframework.stereotype.Service;
|
|||||||
@Service
|
@Service
|
||||||
public class HttpLoggingService {
|
public class HttpLoggingService {
|
||||||
|
|
||||||
@Autowired
|
static Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
|
||||||
|
|
||||||
|
@Autowired
|
||||||
private HttpAdapterExtraLogMapper mapper;
|
private HttpAdapterExtraLogMapper mapper;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
@@ -24,6 +27,7 @@ public class HttpLoggingService {
|
|||||||
if (EAIDBLogControl.isEnable()) {
|
if (EAIDBLogControl.isEnable()) {
|
||||||
try {
|
try {
|
||||||
dbLogger.save(httpAdapterExtraLog);
|
dbLogger.save(httpAdapterExtraLog);
|
||||||
|
logger.debug("inserted to DB");
|
||||||
} catch(Exception e){
|
} catch(Exception e){
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
// 오류 메시지 추가 - Could not open JPA EntityManager for transaction; nested exception is org.hibernate.exception.JDBCConnectionException: Unable to acquire JDBC Connection
|
// 오류 메시지 추가 - Could not open JPA EntityManager for transaction; nested exception is org.hibernate.exception.JDBCConnectionException: Unable to acquire JDBC Connection
|
||||||
@@ -33,9 +37,11 @@ public class HttpLoggingService {
|
|||||||
EAIDBLogControl.setEnable(false);
|
EAIDBLogControl.setEnable(false);
|
||||||
}
|
}
|
||||||
fileLogger.writeFileLog(httpAdapterExtraLog);
|
fileLogger.writeFileLog(httpAdapterExtraLog);
|
||||||
|
logger.debug("wrote to File");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
fileLogger.writeFileLog(httpAdapterExtraLog);
|
fileLogger.writeFileLog(httpAdapterExtraLog);
|
||||||
|
logger.debug("wrote to File");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,24 +2,25 @@ package com.eactive.eai.common.util;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.apache.hc.core5.http.Header;
|
||||||
|
|
||||||
import com.eactive.eai.common.logger.HttpAdapterExtraHeaderVo;
|
import com.eactive.eai.common.logger.HttpAdapterExtraHeaderVo;
|
||||||
import com.eactive.eai.common.logger.HttpAdapterExtraLogVo;
|
import com.eactive.eai.common.logger.HttpAdapterExtraLogVo;
|
||||||
import com.eactive.eai.common.logger.HttpLoggingService;
|
import com.eactive.eai.common.logger.HttpLoggingService;
|
||||||
import com.eactive.eai.common.logger.async.AsyncHttpLoggingPoolManager;
|
import com.eactive.eai.common.logger.async.AsyncHttpLoggingPoolManager;
|
||||||
import com.eactive.eai.env.ElinkConfig;
|
import com.eactive.eai.env.ElinkConfig;
|
||||||
import org.apache.hc.core5.http.Header;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
|
|
||||||
|
|
||||||
public class HttpAdapterExtraLogUtil {
|
public class HttpAdapterExtraLogUtil {
|
||||||
|
public static final int MAX_HEADER_VALUE_SIZE = 400;
|
||||||
|
public static final String BODY_FIELD_NAME = "eapim-adapter-send-body";
|
||||||
static Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
|
static Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
|
||||||
|
|
||||||
public static boolean isHttpHeaderMode() {
|
public static boolean isHttpHeaderMode() {
|
||||||
@@ -62,14 +63,19 @@ public class HttpAdapterExtraLogUtil {
|
|||||||
httpAdapterExtraLogVo.setHttpMethod(httpMethod);
|
httpAdapterExtraLogVo.setHttpMethod(httpMethod);
|
||||||
|
|
||||||
for (HttpAdapterExtraHeaderVo httpAdapterExtraHeaderVo : headerVoList) {
|
for (HttpAdapterExtraHeaderVo httpAdapterExtraHeaderVo : headerVoList) {
|
||||||
|
// String name = httpAdapterExtraHeaderVo.getName();
|
||||||
|
// if(StringUtils.isNotBlank(name) && "authorization".equals(name.toLowerCase())) {
|
||||||
|
// httpAdapterExtraHeaderVo.setValue("{hidden}");
|
||||||
|
// }
|
||||||
String value = httpAdapterExtraHeaderVo.getValue();
|
String value = httpAdapterExtraHeaderVo.getValue();
|
||||||
|
if(StringUtils.isNotBlank(value) && value.length() > MAX_HEADER_VALUE_SIZE) {
|
||||||
if (value == null) {
|
value = value.substring(0, 400) + "...";
|
||||||
httpAdapterExtraHeaderVo.setValue(" ");
|
httpAdapterExtraHeaderVo.setValue(value);
|
||||||
}
|
}else if(value == null){
|
||||||
|
httpAdapterExtraHeaderVo.setValue(" ");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
httpAdapterExtraLogVo.setHeaderList(headerVoList);
|
httpAdapterExtraLogVo.setHeaderList(headerVoList);
|
||||||
httpAdapterExtraLogVo.setHttpStatus(httpStatus);
|
httpAdapterExtraLogVo.setHttpStatus(httpStatus);
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package com.eactive.eai.common.util;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
|
import com.eactive.eai.common.property.PropManager;
|
||||||
|
import com.eactive.eai.common.util.HttpAdapterExtraLogUtil;
|
||||||
|
|
||||||
|
public class RestSendBodyLogUtils {
|
||||||
|
|
||||||
|
private static final String PROP_LOG_MAX_DATA_SIZE = "log.max.data.size";
|
||||||
|
private static final String PROP_GROUP = "RestSendBodyLog";
|
||||||
|
|
||||||
|
private RestSendBodyLogUtils() {
|
||||||
|
throw new IllegalStateException("Utility class");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API ID 별 어댑터 body 로그 남기는 지 여부
|
||||||
|
*
|
||||||
|
* @param apiId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static boolean isBodyLoggingApi(String apiId) {
|
||||||
|
if (StringUtils.isEmpty(apiId))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
String logging = PropManager.getInstance().getProperty(PROP_GROUP, apiId, "N");
|
||||||
|
return StringUtils.equals("Y", logging);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* body 로그에 남길 만큼 자르기
|
||||||
|
*
|
||||||
|
* @param body
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String getBodyByMaxSize(String body) {
|
||||||
|
String maxDataSize = PropManager.getInstance().getProperty(PROP_GROUP, PROP_LOG_MAX_DATA_SIZE);
|
||||||
|
int imaxDataSize = HttpAdapterExtraLogUtil.MAX_HEADER_VALUE_SIZE;
|
||||||
|
if (maxDataSize != null)
|
||||||
|
imaxDataSize = Integer.parseInt(maxDataSize);
|
||||||
|
|
||||||
|
if (body.length() > imaxDataSize)
|
||||||
|
return StringUtils.substring(body, 0, imaxDataSize) + "...";
|
||||||
|
|
||||||
|
return body;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -98,6 +98,10 @@ public class RESTProcess extends HTTPProcess {
|
|||||||
this.timeout = iTimeoutValue * 1000;
|
this.timeout = iTimeoutValue * 1000;
|
||||||
this.tempProp.put(INTERFACE_TIME_OUT, "" + this.timeout);
|
this.tempProp.put(INTERFACE_TIME_OUT, "" + this.timeout);
|
||||||
|
|
||||||
|
this.tempProp.put("API_SERVICE_CODE", this.reqEaiMsg.getEAISvcCd());
|
||||||
|
this.tempProp.put("OUT_REQ_EAI_MSG", this.reqEaiMsg);
|
||||||
|
this.tempProp.put("OUT_REQ_STD_MSG", this.reqEaiMsg.getStandardMessage());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// API별 이용
|
// API별 이용
|
||||||
String apiId = reqEaiMsg.getEAISvcCd();
|
String apiId = reqEaiMsg.getEAISvcCd();
|
||||||
|
|||||||
Reference in New Issue
Block a user