simpleframework에서 추가기능 업무전문에도 GUID 넣을수있게 처리추가.

This commit is contained in:
cho
2026-01-16 10:49:59 +09:00
parent 5712405a24
commit 775d16924c
3 changed files with 30 additions and 0 deletions
@@ -24,6 +24,9 @@ public class HttpClient5AdapterFilterFactory {
case SIMPLEFRAMEWORK:
filter = new SimpleFrameworkFilter();
break;
case SIMPLEFRAMEWORKBODY:
filter = new SimpleframeworkBodyFilter();
break;
case JBOBP:
filter = new JBOBPFilter();
break;
@@ -2,6 +2,7 @@ package com.eactive.eai.custom.kjb.adapter.http.client.filter;
public enum HttpClient5AdapterFilterType {
SIMPLEFRAMEWORK,
SIMPLEFRAMEWORKBODY,
JBOBP,
KFTCFACE,
KFTCP2P,
@@ -0,0 +1,26 @@
package com.eactive.eai.custom.kjb.adapter.http.client.filter;
import java.util.Properties;
import org.json.simple.JSONObject;
import org.json.simple.JSONValue;
import com.eactive.eai.common.TransactionContextKeys;
public class SimpleframeworkBodyFilter extends SimpleFrameworkFilter {
@Override
public Object doPreFilter(String adptGrpName, String adptName, Properties prop, Object message, Properties tempProp)
throws Exception {
Object returnMessage = super.doPreFilter(adptGrpName, adptName, prop, message, tempProp);
JSONObject bizJsonStr = null;
if ( returnMessage instanceof String ) {
bizJsonStr = (JSONObject) JSONValue.parse( (String)returnMessage);
bizJsonStr.put("GUID", tempProp.get(TransactionContextKeys.GUID));
}
return bizJsonStr != null ? bizJsonStr.toJSONString() : returnMessage;
}
}