1
這是當前代碼..如何在對客戶端的響應之後提取有效負載?
@Bean
public IntegrationFlow flowForHandlingPlainEncryptHistory() {
return IntegrationFlows.from(InputWithPlainEncryptHistory())
.handle(ENCRYPT_HISTORY_SERVICE, EXTRACT_ENCRYPT_HISTORY)
.channel(outputWithPlainStringOfXml()).get();
}
方法,在ENCRYPT_HISTORY
的插入DB工作,並返回成功。
但是,爲了提高速度
無條件返回成功,然後嘗試插入一個數據庫。
@Bean
public IntegrationFlow flowForHandlingPlainEncryptHistory() {
return IntegrationFlows.from(InputWithPlainEncryptHistory())
.handle(ENCRYPT_HISTORY_SERVICE, "extractEncryptHistoryReturn")
.channel(outputWithPlainStringOfXml()
.handle(ENCRYPT_HISTORY_SERVICE, "extractEncryptHistoryInsert").get();
}
@Override
public Object extractEncryptHistoryReturn(Object payload) throws Exception {
log.debug("[INFO] extractEncryptHistoryReturn payload : {}", payload.toString());
Map<String, Object> result = initResult();
result.put(Constant.KEY_NAME_RESULT_CODE, Constant.CODE_SUCCESS);
result.put(Constant.KEY_NAME_RESULT_MSG, Constant.MSG_SUCCESS);
return result;
}
@Override
@Transactional
public void extractEncryptHistoryInsert(Object payload) throws Exception {
log.debug("[INFO] extractEncryptHistoryInsert payload : {}", payload.toString());
Map<String, Object> params = initParam(payload);
try {
long headerInfoSeq = insertHeaderInfo(params);
insertHeaderAclList(headerInfoSeq, (String) params.get("ACL_COUNT"), (String) params.get("ACL_LIST"));
} catch (Exception e) {
log.debug("[ERROR] extractEncryptHistory : Insert errors in the header information and acl list. {}", e.toString());
}
}
extractEncryptHistoryInsert
來到該方法的有效載荷不是第一有效載荷。
我能做些什麼來解決它?