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);
}
}
2条答案
按热度按时间neskvpey1#
Hey @long187
I am interested to work on this project, may I know more details to explore and draft a proposal.
Cheers
Rohit
webghufk2#
有过中型项目重构经历,了解阿里编程基本规范,对代码要求严格,请问是已经写好伪代码,直接写业务嘛?