Skip to content

Commit 0d0b984

Browse files
committed
fix: fix docs
1 parent 6f8f74c commit 0d0b984

File tree

3 files changed

+33
-4
lines changed

3 files changed

+33
-4
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,11 @@ In a good way, each bounded context in a micro-service architecture should have
7070
### Saga
7171

7272
The project uses a saga with choreography and a registrar. The registrar is capable of rolling back transactions in case of failure.
73+
74+
Calling for compensation
7375
![image](https://github.com/user-attachments/assets/334c00b2-9bda-4552-be61-76b2771ee938)
76+
77+
Timeout compensation
7478
![image](https://github.com/user-attachments/assets/6e25acc7-46b5-4ae6-972b-fd9fd164d687)
7579

7680
### Important

docs/SAGA.puml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,9 @@ ServiceA -> ServiceA: run second step
1717
ServiceA --> Registrator: run third step, send second step compensation
1818
ServiceA --> ServiceB: run third step
1919

20+
ServiceB -> ServiceB: run third step
2021

21-
ServiceB -[#red]> ServiceB: run third step (ERROR)
22-
23-
24-
Registrator -> Registrator: third step timeout (12 hours), send compensations
22+
ServiceB --> Registrator: run compensations by sagaId
2523

2624
Registrator --> ServiceA: Compensation for second step
2725
Registrator --> Service: Compensation for first step

docs/SAGA_TIMEOUT.puml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
@startuml saga
2+
title Choreographic Saga with a Registrator
3+
4+
participant "Service" as Service
5+
6+
participant "ServiceA" as ServiceA
7+
participant "ServiceB" as ServiceB
8+
participant "Registrator" as Registrator
9+
10+
Service -> Registrator: run new saga
11+
Registrator --> Service: return SagaId
12+
Service -> Service: run first step
13+
Service --> Registrator: run second step, send first step compensation
14+
Service --> ServiceA: run second step
15+
16+
ServiceA -> ServiceA: run second step
17+
ServiceA --> Registrator: run third step, send second step compensation
18+
ServiceA --> ServiceB: run third step
19+
20+
21+
ServiceB -[#red]> ServiceB: run third step (ERROR)
22+
23+
24+
Registrator -> Registrator: third step timeout (12 hours), send compensations
25+
26+
Registrator --> ServiceA: Compensation for second step
27+
Registrator --> Service: Compensation for first step

0 commit comments

Comments
 (0)