Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Expression support in saga #731

Open
wt-better opened this issue Dec 8, 2024 · 3 comments
Open

Feature: Expression support in saga #731

wt-better opened this issue Dec 8, 2024 · 3 comments

Comments

@wt-better
Copy link
Contributor

wt-better commented Dec 8, 2024

Saga is a distributed transaction processing mode used to ensure consistency in distributed systems.The state machine mode of saga implemented in seata java, it`s needs to be support in seata go.

The saga state machine is composed of state nodes, among which the choice node type determines the routing branch based on the expression result. We can also use expressions to obtain values ​​in the input and output parameters of the state.

Example:

{
            "Type": "Choice",
            "Choices":[
                {
                    "Expression":"[a] == 1",
                    "Next":"SecondState"
                },
                {
                    "Expression":"[a] == 2",
                    "Next":"ThirdState"
                }
            ],
            "Default":"Fail"
        }
{
            "Type": "ServiceTask",
            "ServiceName": "demoService",
            "ServiceMethod": "bar",
            "Input": [
                {
                    "barInput": "$.[fooResult]"
                }
            ],
            "Output": {
                "result": "$.result"
            },
            "Next": "Succeed"
        }

We need to implement expression execution and parsing. Considering the development trend of Seata in multiple languages, we need to choose a language-independent and neutral expression engine. For example, Google's Cel. You can also refer to other frameworks such as Argo and Lamba to make a selection and development.

@wt-better
Copy link
Contributor Author

link: #640

@wt-better
Copy link
Contributor Author

There has been one history implementation, corresponding to the branch: feature/saga, but the details need to be completed. you can develop on this branch.

@kaori-seasons
Copy link
Contributor

i want to try

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants