You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2020/03/30 07:57:32 UTC

[GitHub] [servicecomb-pack] Richhardbranson commented on issue #643: 分布式事务优雅shut down服务问题

Richhardbranson commented on issue #643: 分布式事务优雅shut down服务问题
URL: https://github.com/apache/servicecomb-pack/issues/643#issuecomment-605843124
 
 
   服务A call 服务B   
   服务B代码 如下:
   ``` java
           @Transactional
   	@Compensable(compensationMethod = "cancel",retries=5)
   	@Override
   	@DtIdempotent
   	public void updateUserCoinWallet(UpdateUserCoinWalletReq req) {
   		logger.error("钱包【uid={},coinId={}】,begin" +
   				"更新钱包,globalTxId={}", req.getUid(),req.getCoinId(),req.getGlobalTxId()) ;
   		List<String> keys = new ArrayList<>();
   		List<Object> argList = new ArrayList<>();
                   ... ...
           }
            @Transactional
   	 @DtIdempotent
   	 public void cancel(UpdateUserCoinWalletReq req) {
   		 logger.error("钱包【uid={},coinId={}】,撤销更新,globalTxId={}",  req.getUid(),req.getCoinId(),req.getGlobalTxId()) ;
   		List<String> keys = new ArrayList<>();
   		List<String> argList = new ArrayList<>();
   		... ...
            }
   ```
   服务A中通过SagaStart注解 启动saga事务管理。
   
   服务B 只配置一个实例,在进行重启的时候(启动时长约1分钟) ,重启完成后发现部分事务没有补偿成功。
   
   
   
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services