apache / apache/incubator-seata

Provide annotated saga mode

Open
#2,712 2 comments 1 reaction 1 assignee View on GitHub

@long187 is already working on this.

Since May 21, 2020.

theme: ASoC2020
Dominant language
Java
Stars
26k
Forks
8.8k
Avg merge
1d 8h
Merged PRs (30d)
4

Description

Why you need it?

Provide annotated saga mode:

  • At present, SEATA has realized the orchestration Saga mode. The annotated saga can write business process directly through code. The cost of business process development is lower. Here is the pseudo code of annotation mode:
@SagaCompensatable(method="compensateOne", retryCount=3, retryIntervalSeconds=1.5, retryBackoffRate=1.5)
public Map<String, Object> one(String id, BeanA beanA){
    return null;
}

public boolean compensateOne(Context context){
    return true;
}

@SagaTransactional(compensateBy=CompensationException.class, lazyStart=true)
public Map<String, Object> processA(String id, BeanA beanA){
    Map<String, Object> oneResult = one(id, beanA);
    if("SUCCESS".equals(oneResult.get("RETURN_CODE"))){
        Map<String, Object> twoResult = two(id, beanA);
        return twoResult;
    }
    else{
        throw new CompensationException("ERROR_CODE", args);
    }
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.