You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/shared_queue/README.md
+40-11
Original file line number
Diff line number
Diff line change
@@ -7,28 +7,57 @@ There are two Wasm VMs are configured (See `envoy.yaml` for detail):
7
7
1. The one with `vm_id="receiver"` and the binary of `receiver/main.go`.
8
8
2. Another one with `vm_id="sender"` and the binary of `sender/main.go`.
9
9
10
-
`receiver` VM runs as a singleton [Wasm Service](https://www.envoyproxy.io/docs/envoy/latest/configuration/other_features/wasm_service.html) which runs in the main thread, and registered a shared queue named `http_headers` by calling the `RegisterSharedQueue` host call.
10
+
`receiver` VM runs as a singleton [Wasm Service](https://www.envoyproxy.io/docs/envoy/latest/configuration/other_features/wasm_service.html) which runs in the main thread, and there are **three** plugin configurations are given. These configuration values are `http_response_headers`, `http_request_headers` and `tcp_data_hashes`.
11
+
Each of these corresponding PluginContext registers a shared queue whose name equals that configuration respectively.
11
12
12
-
`sender` VM runs in the http filter chain on worker threads, and enqueue request headers to the shared queue resolved by the `ResolveSharedQueue` with the args of `vm_id=receiver` and `name=http_headers`.
13
+
`sender` VM runs in a http filter and a network filter chain on worker threads, and
14
+
- enqueue request headers to the shared queue resolved by the `ResolveSharedQueue` with the args of (`vm_id=receiver`,`name=http_request_headers`) and (`vm_id=receiver`,`name=http_response_headers`).
15
+
- enqueue hash values of tcp data frames to the shared queue resolved by the `ResolveSharedQueue` with the args of (`vm_id=receiver`,`name=tcp_data_hashes`).
13
16
14
17
See [this talk](https://www.youtube.com/watch?v=XdWmm_mtVXI&t=1171s) for detail.
15
18
16
19
17
20
```bash
21
+
wasm log receiver: queue "http_request_headers" registered as queueID=1 by contextID=1
22
+
wasm log receiver: queue "http_request_headers" registered as queueID=1 by contextID=1
23
+
wasm log receiver: queue "http_response_headers" registered as queueID=2 by contextID=2
24
+
wasm log receiver: queue "tcp_data_hashes" registered as queueID=3 by contextID=3
25
+
all clusters initialized. initializing init manager
26
+
all dependencies initialized. starting workers
27
+
wasm log sender: contextID=1 is configured for http
28
+
wasm log sender: contextID=2 is configured for tcp
29
+
wasm log sender: contextID=1 is configured for http
30
+
wasm log sender: contextID=2 is configured for tcp
0 commit comments