|
8 | 8 | import com.java110.common.cache.MappingCache;
|
9 | 9 | import com.java110.common.constant.*;
|
10 | 10 | import com.java110.common.exception.*;
|
| 11 | +import com.java110.common.factory.ApplicationContextFactory; |
11 | 12 | import com.java110.common.kafka.KafkaFactory;
|
12 | 13 | import com.java110.common.log.LoggerEngine;
|
13 | 14 | import com.java110.common.util.*;
|
|
23 | 24 | import com.java110.event.center.DataFlowEventPublishing;
|
24 | 25 |
|
25 | 26 | import com.java110.log.agent.LogAgent;
|
| 27 | +import com.java110.service.init.ServiceInfoListener; |
26 | 28 | import com.java110.service.smo.IQueryServiceSMO;
|
27 | 29 | import org.apache.commons.lang3.math.NumberUtils;
|
28 | 30 | import org.springframework.beans.factory.annotation.Autowired;
|
@@ -508,7 +510,9 @@ private void transferInvokeBusinessSystem(DataFlow dataFlow) throws BusinessExce
|
508 | 510 | dataFlow.setResData(responseJson);
|
509 | 511 |
|
510 | 512 | DataFlowFactory.addCostTime(dataFlow,dataFlow.getCurrentBusiness().getServiceCode(), "调用"+dataFlow.getCurrentBusiness().getServiceCode()+"耗时", startDate);
|
511 |
| - saveLogMessage(dataFlow.getCurrentBusiness().getTransferData(),dataFlow.getResData()); |
| 513 | + saveLogMessage(dataFlow,LogAgent.createLogMessage(dataFlow.getRequestCurrentHeaders(),dataFlow.getCurrentBusiness().getTransferData()), |
| 514 | + LogAgent.createLogMessage(dataFlow.getResponseCurrentHeaders(),dataFlow.getResData()), |
| 515 | + DateUtil.getCurrentDate().getTime()-startDate.getTime()); |
512 | 516 |
|
513 | 517 |
|
514 | 518 | DataFlowFactory.addCostTime(dataFlow, "invokeBusinessSystem", "调用下游系统耗时", startDate);
|
@@ -776,6 +780,11 @@ private void reloadOrderInfoAndConfigData(DataFlow dataFlow) {
|
776 | 780 | if("-1".equals(dataFlow.getDataFlowId()) || StringUtil.isNullOrNone(dataFlow.getDataFlowId())){
|
777 | 781 | throw new InitConfigDataException(ResponseConstant.RESULT_CODE_ERROR,"请求报文中没有包含 dataFlowId 节点");
|
778 | 782 | }
|
| 783 | + //重新刷端口信息 |
| 784 | + ServiceInfoListener serviceInfoListener = ApplicationContextFactory.getBean("serviceInfoListener",ServiceInfoListener.class); |
| 785 | + if(serviceInfoListener != null){ |
| 786 | + dataFlow.setPort(serviceInfoListener.getServerPort()+""); |
| 787 | + } |
779 | 788 | //重新加载配置
|
780 | 789 | initConfigData(dataFlow);
|
781 | 790 | }
|
@@ -1164,7 +1173,8 @@ private void doAsynchronousBusinesses(DataFlow dataFlow) throws BusinessExceptio
|
1164 | 1173 | dataFlow.setResponseBusinessJson(DataTransactionFactory.createOrderResponseJson(dataFlow.getTransactionId(),
|
1165 | 1174 | ResponseConstant.RESULT_CODE_SUCCESS, "成功"));
|
1166 | 1175 | DataFlowFactory.addCostTime(dataFlow, "doSynchronousBusinesses", "异步调用业务系统总耗时", startDate);
|
1167 |
| - saveLogMessage(dataFlow,dataFlow.getRequestBusinessJson(),dataFlow.getResponseBusinessJson(), |
| 1176 | + saveLogMessage(dataFlow,LogAgent.createLogMessage(dataFlow.getRequestCurrentHeaders(),dataFlow.getRequestBusinessJson().toJSONString()), |
| 1177 | + LogAgent.createLogMessage(dataFlow.getRequestCurrentHeaders(),dataFlow.getResponseBusinessJson().toJSONString()), |
1168 | 1178 | DateUtil.getCurrentDate().getTime()-startDate.getTime());
|
1169 | 1179 | }
|
1170 | 1180 |
|
|
0 commit comments