Skip to content

Commit 2d06abf

Browse files
committed
doc
1 parent ab780a4 commit 2d06abf

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

ARQUITECTURE.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
```mermaid
2+
3+
sequenceDiagram
4+
box Data Consolidation
5+
participant ConsolidationService
6+
end
7+
8+
participant SegmentClient
9+
box HTTP
10+
participant QueueHttp
11+
participant LooperHttp
12+
participant SegmentAPI
13+
end
14+
box File
15+
participant QueueFile
16+
participant WriteFile
17+
participant File
18+
participant WatchFile
19+
end
20+
21+
activate ConsolidationService
22+
ConsolidationService->>+SegmentClient: enqueue
23+
SegmentClient<<->>QueueHttp: offer
24+
alt QueueHttp overflow
25+
SegmentClient<<->>QueueFile: put
26+
end
27+
SegmentClient->>-ConsolidationService:
28+
deactivate ConsolidationService
29+
30+
loop consume QueueHttp
31+
LooperHttp->>QueueHttp:take
32+
activate LooperHttp
33+
end
34+
LooperHttp->>SegmentAPI: batchUpload
35+
note over LooperHttp,SegmentAPI: Batch
36+
note over LooperHttp,SegmentAPI: CircuitBreaker and Retry
37+
note over LooperHttp,SegmentAPI: HTTP requests submited to a pool
38+
deactivate LooperHttp
39+
40+
alt retry exhausted or circuit open
41+
note over LooperHttp: pool threads
42+
LooperHttp->>QueueFile: put
43+
end
44+
45+
loop consume QueueFile
46+
WriteFile->>QueueFile:take
47+
activate WriteFile
48+
end
49+
WriteFile->>File: write
50+
note over WriteFile: Batch and save file
51+
deactivate WriteFile
52+
53+
note over WatchFile: check last written
54+
activate WatchFile
55+
loop watch QueueFile
56+
WatchFile->>File: read and remove
57+
WatchFile->>QueueHttp: offer
58+
end
59+
deactivate WatchFile
60+
```

0 commit comments

Comments
 (0)