aeraki-mesh / aeraki

Manage any layer-7 protocols in a Service Mesh.
https://www.aeraki.net
Apache License 2.0
740 stars 140 forks source link

trpc is now opensource, can we support it? #398

Closed caibirdme closed 9 months ago

caibirdme commented 10 months ago

Here's the trpc-protocol Hope aeraki could support it

zhaohuabing commented 10 months ago

Actually, I wrote the trpc codec for metaprotocol when I was at Tencent. Are you from Tencent? If you're, could you please help also open source that codec and maybe raise a PR to add it to the MetaPeotocol repo?

@zhongfox @Xunzhuo @woluohenga @ianyuan26

Xunzhuo commented 10 months ago

I can help on that

zhaohuabing commented 9 months ago

@caibirdme tRPC has been supported.

Follow the below steps to install trpc demo and try it:

In a kind cluster:

git clone https://github.com/aeraki-mesh/aeraki.git

cd aeraki

make demo

./demo/metaprotocol-trpc/install.sh
$ k -n meta-trpc get pod 
NAME                                                     READY   STATUS    RESTARTS   AGE
trpc-sample-client-bidirection-stream-77fb4f6d89-tr5hz   2/2     Running   0          18m
trpc-sample-client-stream-794cb4556f-mslkh               2/2     Running   0          18m
trpc-sample-client-unary-55f9cd4d6c-49k72                2/2     Running   0          18m
trpc-sample-server-stream-7c6b44788f-lj6nc               2/2     Running   0          18m
trpc-sample-server-v1-844ccb9dc4-q92t5                   2/2     Running   0          18m
trpc-sample-server-v2-7886559675-h9knp                   2/2     Running   0          18m

unary examp

$ k -n meta-trpc logs trpc-sample-client-unary-55f9cd4d6c-49k72  --tail 10
2023-12-17 07:08:45.270 DEBUG   client/main.go:77   client: send req:trpc-go-client-1
2023-12-17 07:08:45.274 DEBUG   client/main.go:83   client: receive rsp:response from :trpc-sample-server-v2-7886559675-h9knp
2023-12-17 07:08:46.275 DEBUG   client/main.go:77   client: send req:trpc-go-client-1
2023-12-17 07:08:46.278 DEBUG   client/main.go:83   client: receive rsp:response from :trpc-sample-server-v1-844ccb9dc4-q92t5
2023-12-17 07:08:47.279 DEBUG   client/main.go:77   client: send req:trpc-go-client-1
2023-12-17 07:08:47.283 DEBUG   client/main.go:83   client: receive rsp:response from :trpc-sample-server-v1-844ccb9dc4-q92t5
2023-12-17 07:08:48.283 DEBUG   client/main.go:77   client: send req:trpc-go-client-1
2023-12-17 07:08:48.289 DEBUG   client/main.go:83   client: receive rsp:response from :trpc-sample-server-v1-844ccb9dc4-q92t5
2023-12-17 07:08:49.289 DEBUG   client/main.go:77   client: send req:trpc-go-client-1
2023-12-17 07:08:49.293 DEBUG   client/main.go:83   client: receive rsp:response from :trpc-sample-server-v1-844ccb9dc4-q92t5

stream example

$ k -n meta-trpc logs trpc-sample-client-stream-794cb4556f-mslkh --tail 10
2023-12-17 07:09:31.210 DEBUG   client/main.go:103  client: send stream req:trpc-go-client-5
发送data帧
2023-12-17 07:09:32.711 DEBUG   client/main.go:114  client: send close stream req to server
发送close帧
收到data帧
收到close帧
2023-12-17 07:09:33.213 DEBUG   client/main.go:118  client: client stream closed. rsp:msg:"response from :trpc-sample-server-v1-844ccb9dc4-q92t5"
发送init帧
2023-12-17 07:09:34.217 DEBUG   client/main.go:103  client: send stream req:trpc-go-client-1
caibirdme commented 9 months ago

Thx a lot