-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathrpc_flow.puml
More file actions
108 lines (92 loc) · 2.66 KB
/
rpc_flow.puml
File metadata and controls
108 lines (92 loc) · 2.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
@startuml
'https://plantuml.com/sequence-diagram
autonumber
title Direct RPC Flow (not through Gateway/DPR)
box uP-Foo (UAuthority="Device1") #white
actor uApp #red
boundary uPClientFoo as upc1 #black
boundary uPClientFoo as upc2 #black
entity uStreamer as uS1 #green
boundary uPClientBar as upc3 #black
end box
box uP-Bar (UAuthority="Device2") #white
boundary uPClientBar as upc4 #black
entity uService #blue
end box
== Setup uTransport Listeners ==
uS1 -[#green]>upc2: registerListener(\n\tUUri,\n\tUListener)
note right
UUri = "//Device2/*"
end note
upc2 -[#green]->uS1: UStatus
uS1 -[#green]>upc3: registerListener(\n\tUUri,\n\tUListener)
note right
UUri = "//Device1/*"
end note
upc3 -[#green]->uS1: UStatus
uService -> upc4: registerRpcListener(\n\tUUri,\n\tURpcListener)
note left
UUri = "/uService/rpc.myMethod"
end note
upc4 --> uService: UStatus
== Request ==
uApp -> upc1 : invokeMethod(\n\tUUri, \n\tUPayload, \n\tCallOptions)
note right
<size:12>**UUri:**</size>
authority:{name: "Device2", ip: "192.168.1.100"}
entity: {name: "uService", version_major: 1, id: 99}
resource: {name: "rpc", instance: "myMethod", id: 1}
end note
upc1 -> upc1: Build request
note right
<size:12>**Request UMessage:**</size>
source: {
\tauthority:{name: "Device1", ip: "192.168.1.101"}
\tentity: {name: "uApp", version_major: 1, id: 300}
\tresource: {name: "rpc", instance: "response", id: 0}
}
payload: { /* Request Payload */ }
attributes: {
\tid: /* UUID */,
\ttype: UMESSAGE_TYPE_REQUEST
\tpriority: UPRIORITY_CS4
\tttl: 10000
\tsink: {
\t\tauthority:{name: "Device2", ip: "192.168.1.100"}
\t\tentity: {name: "uService", version_major: 1, id: 99}
\t\tresource: {name: "rpc", instance: "myMethod", id: 1}
\t}
}
end note
upc1 -[#green]> upc1:send(request)
upc1 <-[#blue]> upc2: Foo
upc1 --> uApp: Future
upc2 -[#green]> uS1: onReceive(request)
uS1 -> uS1: Queuing & routing
uS1 -[#green]> upc3:send(request)
upc3 <-[#blue]> upc4: Bar
upc4 -[#green]> upc4: onReceive(request)
upc4 ->uService: onReceive(request)
== Response ==
uService -> uService: Process req,\nbuild res
note left
<size:12>**Response UMessage:**</size>
source: //Device2/uService/rpc.myMethod"" }
""payload: { /* Request Payload */ }
""attributes: {
\tid: /* UUID */,
\ttype: UMESSAGE_TYPE_RESPONSE
\tpriority: UPRIORITY_CS4
\tttl: 10000
\tsink: //Device1/uApp/1/rpc.response
\treqid: /* Request attributes.id */
}
end note
uService -[#green]> upc4:send(response)
upc4 <-[#blue]> upc3: Bar
upc3 -[#green]> uS1: onReceive(response)
uS1 -[#green]>upc2:send(response)
upc2 <-[#blue]> upc1: Foo
upc2 -[#green]->uS1: UStatus
upc1 --\uApp: Future<response>\n\t.complete()
@enduml