coolbeevip edited a comment on issue #562: 服用调用问题 URL: https://github.com/apache/servicecomb-pack/issues/562#issuecomment-534380731 > 是的,前提是在B->C的调用时要把 gobal_transaction_id加到http header当中,并且在C的调用方法之前能够正确的加入全局事务中。所以我想看看他的代码是怎么写的。 哦,我还真没注意这种情况,如果 A,B,C 三个服务方法的注解采用如下方式,会自动传递 globalTxId吗? A @SagaStart B @Compensable C @Compensable 我在 @Compensable的 TransactionContextHelper 中找到如下代码 ```java protected void populateOmegaContext(OmegaContext context, TransactionContext transactionContext) { if (context.globalTxId() != null) { getLogger() .warn("The context {}'s globalTxId is not empty. Update it for globalTxId:{} and localTxId:{}", context, transactionContext.globalTxId(), transactionContext.localTxId()); } else { getLogger() .debug("Updated context {} for globalTxId:{} and localTxId:{}", context, transactionContext.globalTxId(), transactionContext.localTxId()); } context.setGlobalTxId(transactionContext.globalTxId()); context.setLocalTxId(transactionContext.localTxId()); } ```
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
