File tree Expand file tree Collapse file tree 1 file changed +60
-0
lines changed
Expand file tree Collapse file tree 1 file changed +60
-0
lines changed Original file line number Diff line number Diff line change 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+ ```
You can’t perform that action at this time.
0 commit comments