Merge branch 'jenkins_with_weblogic' of http://192.168.240.178:18080/eapim/elink-online-common.git into jenkins_with_weblogic
This commit is contained in:
+2
@@ -418,6 +418,8 @@ public abstract class HttpClient5AdapterServiceSupport implements HttpClientAdap
|
|||||||
};
|
};
|
||||||
|
|
||||||
this.client = HttpClients.custom()
|
this.client = HttpClients.custom()
|
||||||
|
.disableDefaultUserAgent()
|
||||||
|
.disableContentCompression()
|
||||||
.addRequestInterceptorLast(requestLogInterceptor)
|
.addRequestInterceptorLast(requestLogInterceptor)
|
||||||
.addResponseInterceptorFirst(responseLogInterceptor)
|
.addResponseInterceptorFirst(responseLogInterceptor)
|
||||||
.setConnectionManager(connectionManager)
|
.setConnectionManager(connectionManager)
|
||||||
|
|||||||
+21
@@ -0,0 +1,21 @@
|
|||||||
|
package com.eactive.eai.adapter.http.client.impl;
|
||||||
|
|
||||||
|
import com.eactive.eai.adapter.http.client.HttpClientAdapterService;
|
||||||
|
import com.eactive.eai.httpouttlsinfo.HttpOutTlsInfoVO;
|
||||||
|
|
||||||
|
import java.util.Properties;
|
||||||
|
|
||||||
|
public class HttpClientAdapterServiceNoop implements HttpClientAdapterService {
|
||||||
|
public Object execute(Properties prop, Object data, Properties tempProp) throws Exception {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void close() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init(String adapterName, boolean useMtls, HttpOutTlsInfoVO mtlsInfo, int maxTotalConnections, int maxHostConnections) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
+2
-1
@@ -193,7 +193,8 @@ public class HttpClientAccessTokenServiceWithParam implements HttpClientAccessTo
|
|||||||
connectionManager.setMaxTotal(maxTotalConnections);
|
connectionManager.setMaxTotal(maxTotalConnections);
|
||||||
connectionManager.setDefaultMaxPerRoute(maxHostConnections);
|
connectionManager.setDefaultMaxPerRoute(maxHostConnections);
|
||||||
|
|
||||||
try (CloseableHttpClient httpClient = HttpClients.custom().setConnectionManager(connectionManager).build();) {
|
// http header에 zip 제외하려면 disableContentCompression() 추가해서 제외할것
|
||||||
|
try (CloseableHttpClient httpClient = HttpClients.custom().setConnectionManager(connectionManager).disableContentCompression().disableDefaultUserAgent().build();) {
|
||||||
HttpPost httpPost = new HttpPost(uri);
|
HttpPost httpPost = new HttpPost(uri);
|
||||||
httpPost.setEntity(new UrlEncodedFormEntity(formParams, charset));
|
httpPost.setEntity(new UrlEncodedFormEntity(formParams, charset));
|
||||||
httpPost.setHeader("Content-Type", "application/x-www-form-urlencoded; charset=" + encode);
|
httpPost.setHeader("Content-Type", "application/x-www-form-urlencoded; charset=" + encode);
|
||||||
|
|||||||
@@ -3,7 +3,9 @@ package com.eactive.eai.common.message;
|
|||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.Charset;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import com.eactive.eai.message.StandardMessage;
|
import com.eactive.eai.message.StandardMessage;
|
||||||
import com.eactive.eai.message.manager.StandardMessageManager;
|
import com.eactive.eai.message.manager.StandardMessageManager;
|
||||||
@@ -107,6 +109,7 @@ public class EAIMessage implements EAIMessageKeys, Serializable, Comparable<EAIM
|
|||||||
|
|
||||||
private String authCheckdYn;
|
private String authCheckdYn;
|
||||||
|
|
||||||
|
|
||||||
public EAIMessage() {
|
public EAIMessage() {
|
||||||
this.svcMsgs = new ArrayList<>();
|
this.svcMsgs = new ArrayList<>();
|
||||||
this.svcPssSeq = 1;
|
this.svcPssSeq = 1;
|
||||||
@@ -624,6 +627,42 @@ public class EAIMessage implements EAIMessageKeys, Serializable, Comparable<EAIM
|
|||||||
this.authCheckdYn = authCheckdYn;
|
this.authCheckdYn = authCheckdYn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* [주의] 비동기 JMS 전달 전용 - 직접 사용 금지!
|
||||||
|
*
|
||||||
|
* 이 필드는 비동기 거래 시 JMS ObjectMessage 직렬화를 통해
|
||||||
|
* Consumer 스레드로 컨텍스트를 전달하기 위한 용도로만 사용됩니다.
|
||||||
|
*
|
||||||
|
* 컨텍스트 값 읽기/쓰기는 반드시 ElinkTransactionContext를 사용하세요:
|
||||||
|
* - ElinkTransactionContext.setSeedSalt() / getSeedSalt()
|
||||||
|
* - ElinkTransactionContext.setEncryptionKey() / getEncryptionKey()
|
||||||
|
*
|
||||||
|
* 설정 위치:
|
||||||
|
* - FlowRouter: getAll()로 복사하여 이 필드에 설정
|
||||||
|
* - ElinkESBProcessProxy: 이 필드에서 restore()로 복원
|
||||||
|
*
|
||||||
|
* @see com.eactive.eai.common.context.ElinkTransactionContext
|
||||||
|
*/
|
||||||
|
private Map<String, Object> transactionContextTransfer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* [비동기 전달 전용] 컨텍스트 전달용 Map 반환
|
||||||
|
* @see #transactionContextTransfer
|
||||||
|
*/
|
||||||
|
public Map<String, Object> getTransactionContextTransfer() {
|
||||||
|
return transactionContextTransfer;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* [비동기 전달 전용] 컨텍스트 전달용 Map 설정
|
||||||
|
* @see #transactionContextTransfer
|
||||||
|
*/
|
||||||
|
public void setTransactionContextTransfer(Map<String, Object> transactionContextTransfer) {
|
||||||
|
this.transactionContextTransfer = transactionContextTransfer;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object clone() throws CloneNotSupportedException {
|
public Object clone() throws CloneNotSupportedException {
|
||||||
EAIMessage cloned = (EAIMessage) super.clone();
|
EAIMessage cloned = (EAIMessage) super.clone();
|
||||||
@@ -636,6 +675,8 @@ public class EAIMessage implements EAIMessageKeys, Serializable, Comparable<EAIM
|
|||||||
cloned.setStandardMessage((StandardMessage) standardMessage.clone());
|
cloned.setStandardMessage((StandardMessage) standardMessage.clone());
|
||||||
if (subMessage != null)
|
if (subMessage != null)
|
||||||
cloned.setSubMessage((StandardMessage) subMessage.clone());
|
cloned.setSubMessage((StandardMessage) subMessage.clone());
|
||||||
|
if (transactionContextTransfer != null)
|
||||||
|
cloned.setTransactionContextTransfer(new HashMap<>(transactionContextTransfer));
|
||||||
return cloned;
|
return cloned;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
package com.eactive.eai.common.routing;
|
package com.eactive.eai.common.routing;
|
||||||
|
|
||||||
import com.eactive.eai.common.message.EAIMessage;
|
|
||||||
import com.eactive.eai.common.util.Logger;
|
|
||||||
|
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
|
import com.eactive.eai.common.context.ElinkTransactionContext;
|
||||||
|
import com.eactive.eai.common.message.EAIMessage;
|
||||||
|
import com.eactive.eai.common.message.EAIMessageKeys;
|
||||||
|
import com.eactive.eai.common.util.Logger;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 1. 기능 : ElinkESBProcess를 호출하는 공통 Class
|
* 1. 기능 : ElinkESBProcess를 호출하는 공통 Class
|
||||||
@@ -42,17 +44,30 @@ public class ElinkESBProcessProxy
|
|||||||
public static EAIMessage callElinkESBProcess(String serviceURI, EAIMessage eaiMessage, boolean isLocal, Properties prop) throws Exception
|
public static EAIMessage callElinkESBProcess(String serviceURI, EAIMessage eaiMessage, boolean isLocal, Properties prop) throws Exception
|
||||||
{
|
{
|
||||||
EAIMessage retMsg = null;
|
EAIMessage retMsg = null;
|
||||||
|
|
||||||
|
// [ElinkTransactionContext] 비동기 거래 시 컨텍스트 초기화 여부 판단
|
||||||
|
// - ASYNC 거래이고, outbound Process 호출이 아닌 경우에만 초기화
|
||||||
|
boolean shouldManageContext = eaiMessage != null
|
||||||
|
&& EAIMessageKeys.ASYNC_SVC.equals(eaiMessage.getSvcTsmtUsgTp())
|
||||||
|
&& (serviceURI == null || !serviceURI.startsWith("com.eactive.eai.outbound"));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (isLocal){
|
// [ElinkTransactionContext] 비동기 거래 진입점 - 컨텍스트 복원
|
||||||
|
if (shouldManageContext) {
|
||||||
|
ElinkTransactionContext.restore(eaiMessage.getTransactionContextTransfer());
|
||||||
|
eaiMessage.setTransactionContextTransfer(null); // 복원 후 전달용 필드 초기화
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isLocal){
|
||||||
Class cl = classLocalCache.get(serviceURI);
|
Class cl = classLocalCache.get(serviceURI);
|
||||||
|
|
||||||
if(cl == null) {
|
if(cl == null) {
|
||||||
cl = Class.forName(serviceURI);
|
cl = Class.forName(serviceURI);
|
||||||
classLocalCache.put(serviceURI, cl);
|
classLocalCache.put(serviceURI, cl);
|
||||||
}
|
}
|
||||||
Process proc = (Process)cl.newInstance();
|
Process proc = (Process)cl.newInstance();
|
||||||
proc.callService(eaiMessage, prop);
|
proc.callService(eaiMessage, prop);
|
||||||
|
|
||||||
retMsg = proc.clientReturn();
|
retMsg = proc.clientReturn();
|
||||||
}else{
|
}else{
|
||||||
if(eaiMessage == null) {
|
if(eaiMessage == null) {
|
||||||
@@ -62,12 +77,17 @@ public class ElinkESBProcessProxy
|
|||||||
retMsg = RemoteProxyClient.callProxyBean(eaiMessage, prop);
|
retMsg = RemoteProxyClient.callProxyBean(eaiMessage, prop);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch( ClassNotFoundException e) {
|
} catch( ClassNotFoundException e) {
|
||||||
if (logger.isError()) logger.error("ElinkProcessProxy] callElinkESBProcess["+serviceURI+"] Class Not Found Exception : ");
|
if (logger.isError()) logger.error("ElinkProcessProxy] callElinkESBProcess["+serviceURI+"] Class Not Found Exception : ");
|
||||||
throw new Exception(PROXY_ERROR_CODE);
|
throw new Exception(PROXY_ERROR_CODE);
|
||||||
} catch( Exception e) {
|
} catch( Exception e) {
|
||||||
if (logger.isError()) logger.error("ElinkProcessProxy] callElinkESBProcess["+serviceURI+"] Exception : "+e.getMessage(),e);
|
if (logger.isError()) logger.error("ElinkProcessProxy] callElinkESBProcess["+serviceURI+"] Exception : "+e.getMessage(),e);
|
||||||
throw new Exception(PROXY_ERROR_CODE);
|
throw new Exception(PROXY_ERROR_CODE);
|
||||||
|
} finally {
|
||||||
|
// [ElinkTransactionContext] 비동기 거래 - 해제
|
||||||
|
if (shouldManageContext) {
|
||||||
|
ElinkTransactionContext.clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return retMsg;
|
return retMsg;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.eactive.eai.common.routing;
|
|||||||
|
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
|
||||||
|
import com.eactive.eai.common.context.ElinkTransactionContext;
|
||||||
import com.eactive.eai.common.exception.ExceptionUtil;
|
import com.eactive.eai.common.exception.ExceptionUtil;
|
||||||
import com.eactive.eai.common.message.EAIMessage;
|
import com.eactive.eai.common.message.EAIMessage;
|
||||||
import com.eactive.eai.common.property.PropManager;
|
import com.eactive.eai.common.property.PropManager;
|
||||||
@@ -136,6 +137,8 @@ public class FlowRouter
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
// [ElinkTransactionContext] 비동기 송신 전 컨텍스트 복사
|
||||||
|
eaiMessage.setTransactionContextTransfer(ElinkTransactionContext.getAll());
|
||||||
JMSSender.sendToQueue(eaiMessage, queueConFactory, routeQueueName, prop);
|
JMSSender.sendToQueue(eaiMessage, queueConFactory, routeQueueName, prop);
|
||||||
} catch(Exception e) {
|
} catch(Exception e) {
|
||||||
if (logger.isError()) logger.error(guidLogPrefix +" process.Queue Error. Queue Name[" + routeQueueName + "]- " + e.getMessage(), e);
|
if (logger.isError()) logger.error(guidLogPrefix +" process.Queue Error. Queue Name[" + routeQueueName + "]- " + e.getMessage(), e);
|
||||||
@@ -164,6 +167,8 @@ public class FlowRouter
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
// [ElinkTransactionContext] 비동기 송신 전 컨텍스트 복사
|
||||||
|
eaiMessage.setTransactionContextTransfer(ElinkTransactionContext.getAll());
|
||||||
if (ElinkConfig.isUseCacheTopic()) {
|
if (ElinkConfig.isUseCacheTopic()) {
|
||||||
SessionManager.getInstance().putTopic(traceKey, eaiMessage);
|
SessionManager.getInstance().putTopic(traceKey, eaiMessage);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user