You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@servicecomb.apache.org by GitBox <gi...@apache.org> on 2018/01/11 03:41:59 UTC

[GitHub] eric-lee-ltk commented on a change in pull request #112: [SCB-212] tx timeout

eric-lee-ltk commented on a change in pull request #112: [SCB-212] tx timeout
URL: https://github.com/apache/incubator-servicecomb-saga/pull/112#discussion_r160858722
 
 

 ##########
 File path: omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/SagaStartAnnotationProcessor.java
 ##########
 @@ -19,25 +19,40 @@
 
 import org.apache.servicecomb.saga.omega.context.OmegaContext;
 
-public class SagaStartAnnotationProcessor {
+class SagaStartAnnotationProcessor implements EventAwareInterceptor {
 
   private final OmegaContext omegaContext;
-
   private final MessageSender sender;
 
   SagaStartAnnotationProcessor(OmegaContext omegaContext, MessageSender sender) {
     this.omegaContext = omegaContext;
     this.sender = sender;
   }
 
-  void preIntercept() {
-    String globalTxId = omegaContext.newGlobalTxId();
+  @Override
+  public void preIntercept(String parentTxId, String compensationMethod, Object... message) {
+    String globalTxId = globalTxId();
     // reuse the globalTxId as localTxId to differ localTxId in SagaStartedEvent and the first TxStartedEvent
     sender.send(new SagaStartedEvent(globalTxId, globalTxId));
 
 Review comment:
   move the above to the new method, the use omegaContext.globalTxId(), omegaContext.localTxId() here is better?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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