[
https://issues.apache.org/jira/browse/SCB-212?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16321652#comment-16321652
]
ASF GitHub Bot commented on SCB-212:
------------------------------------
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:
[email protected]
> [pack] sub-transaction timeout support
> --------------------------------------
>
> Key: SCB-212
> URL: https://issues.apache.org/jira/browse/SCB-212
> Project: Apache ServiceComb
> Issue Type: New Feature
> Components: Saga
> Reporter: Yin Xiang
> Assignee: Yin Xiang
>
> as a dev, i want to set timeout on my sub-transaction, so that i can cancel
> or retry to make sure the global tx states across services are consistent
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)