You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@servicecomb.apache.org by "Lei Zhang (JIRA)" <ji...@apache.org> on 2019/07/19 07:01:00 UTC

[jira] [Commented] (SCB-1385) Provide a common way to pass GID and LID

    [ https://issues.apache.org/jira/browse/SCB-1385?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16888586#comment-16888586 ] 

Lei Zhang commented on SCB-1385:
--------------------------------

If there is no standard communication protocol, then we can carry the OmegaContext by class wrapper.

1.Pack needs to provide an interface wrapper definition
interfae IOmegaContextWrapper {
 OmegaContext context;
 Object original;

wrapper(Object original){
 original = original;
 }

Object getOriginal()
 OmegaContext getOmegaContext();
}

2.User implements this interface
class OrderOmegaContextWrapper impl IOmegaContextWrapper {
 
}

3.Wrap the original parameters and send
Order order = new Order();
OrderWrapper orderwrapper = OrderOmegaContextWrapper.wrapper(order);
producer.send(orderwrapper)

4. After the receiver gets the OrderWrapper object, the getOriginal method gets the original parameters.

5. Pack refactoring TransactionAspect, intercepting method parameters, if the parameter implements the interface IOmegaContextWrapper, then you can get OmegaContext from this object.

> Provide a common way to pass GID and LID
> ----------------------------------------
>
>                 Key: SCB-1385
>                 URL: https://issues.apache.org/jira/browse/SCB-1385
>             Project: Apache ServiceComb
>          Issue Type: Improvement
>          Components: Saga
>            Reporter: Willem Jiang
>            Assignee: Willem Jiang
>            Priority: Major
>             Fix For: pack-0.5.0
>
>
> When using SNS https://spring.io/projects/spring-cloud-aws to pass the invocation across the services, it's quite important for Omega to pass the Global Transaction ID and Local Transaction ID across the services.
> I just spend some time to check about the message API of spring-cloud-aws, it has 



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)