imlidian commented on a change in pull request #77:  add saga  quick start
URL: https://github.com/apache/servicecomb-docs/pull/77#discussion_r251190137
 
 

 ##########
 File path: saga-reference/zh_CN/quickstart.md
 ##########
 @@ -0,0 +1,69 @@
+# Apache ServiceComb Pack
+Apache ServiceComb Pack QuickStart
+saga-servicecomb-demo中的Saga代码解读
+
+## 全局事务执行过程
+
+在SagaStartAnnotationProcessor
+Annotation被触发  
+1 当Request发送请求
+2 调用preIntercept 发送 SagaStartedEvent 开始事务  
+3 调用postIntercept 发送 SagaEndedEvent 事务结束执行  
+
+compensableAnnotationProcessor执行补偿  
+路径:servicecomb/saga/omega/transaction/
+
+### EnableOmega
+
+   ```
+   //BookingApplication Class 
 
 Review comment:
   ### Demo中的Saga场景
   上图中:Saga中包含两个组件,即Omega和Alpha, 另外还有用来持久化的DB。  
   结合图一:三个服务,booking、car、hotel均为omega进程,均通过alpha协调。  
   
   ##### Omega像一个agent内嵌各Service中,主要负责:
   * 监控本地事务执行情况,并以Event形式向alpha上报事务执行状态。  
   * 异常情况下根据alpha下发的指令执行相应的补偿操作。    
     
   ##### Alpha充当协调者的角色,主要负责: 
   * 对本地事务的事件进行持久化存储。  
   * 在本地事务与全局事务出现不一致的情况下,Alpha会回调相关Omega进行补偿(最终保持全局事务一致)。  
   
   
例:当异常情况下,如ServiceB的事务执行失败,Alpha扫描到Omega发送的TxAbortedEvent事件,就会回调ServiceA的补偿方法,执行自定义回滚逻辑,使各服务回到事务执行之前的状态。
  
   

----------------------------------------------------------------
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]


With regards,
Apache Git Services

Reply via email to