Skip to content

Commit

Permalink
branch report
Browse files Browse the repository at this point in the history
  • Loading branch information
Bughue committed Feb 7, 2024
1 parent 5af9432 commit 9fd4f63
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,15 @@ protected void doBranchRegister(BranchRegisterRequest request, BranchRegisterRes
@Override
protected void doBranchReport(BranchReportRequest request, BranchReportResponse response, RpcContext rpcContext) throws TransactionException {
checkMockActionFail(request.getXid());
String xid = request.getXid();
branchMap.compute(xid, (key, val) -> {
if (val != null) {
val.stream().filter(branch -> branch.getBranchId() == request.getBranchId()).forEach(branch -> {
branch.setApplicationData(request.getApplicationData());
});
}
return val;
});
response.setResultCode(ResultCode.Success);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ private static void setReq(AbstractBranchEndRequest request, BranchSession branc
request.setXid(branchSession.getXid());
request.setBranchId(branchSession.getBranchId());
request.setResourceId(branchSession.getResourceId());
request.setApplicationData("{\"actionContext\":{\"mock\":\"mock\"}}");
request.setApplicationData(branchSession.getApplicationData());
request.setBranchType(branchSession.getBranchType());
}
}

0 comments on commit 9fd4f63

Please sign in to comment.