分布式事务的两种常见实现方式:
2pc tcc
2pc tcc三阶段提交 try confirm cancel
RocketMQ中采用2pc 两阶段提交
RocketMQ中事务消息流程图
源码:
private GetResult getHalfMsg(MessageQueue messageQueue, long offset) { GetResult getResult = new GetResult(); PullResult result = pullHalfMsg(messageQueue, offset, PULL_MSG_RETRY_NUMBER); getResult.setPullResult(result); ListmessageExts = result.getMsgFoundList(); if (messageExts == null) { return getResult; } getResult.setMsg(messageExts.get(0)); return getResult; }
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)