Grouping data from different RPC methods by the same client

22 views
Skip to first unread message

Jiayi Guo

unread,
Jun 28, 2022, 3:17:39 AMJun 28
to grpc.io
Hi

I am looking for a way to group the data from multiple clients and store them to a database. The service (the Bazel Event Service) has 2 RPC methods, 1 unary and  1 bidirectional streaming RPC using blockingStub and AsyncStub. I am coding a server that should separate data from concurrent clients and group requests to both RPC calls together, probably to store them somewhere. There is a Build_ID field in each request but I am not sure if it's unique for each client, so is there any other way to do it efficiently? 

Language: Java

Thanks!

Jiayi Guo

unread,
Jun 28, 2022, 3:46:03 AMJun 28
to grpc.io
It also includes grouping messages from the same stream.

sanjay...@google.com

unread,
Jun 28, 2022, 11:57:06 AMJun 28
to grpc.io
I guess this is really application logic and not a gRPC issue. You say "There is a Build_ID field in each request but I am not sure if it's unique for each client". Can you combine this with another id say project_id to make it unique?

Jiayi Guo

unread,
Jun 28, 2022, 12:08:44 PMJun 28
to grpc.io
The Project_ID is most often empty. I plan to store requests to both RPC methods in a (maybe concurrentHashMap)HashMap<Build_ID, List<>>, is that a good idea or do you see any problem with that approach?

Sanjay Pujare

unread,
Jun 28, 2022, 12:13:26 PMJun 28
to Jiayi Guo, grpc.io
Seems okay to me

--
You received this message because you are subscribed to a topic in the Google Groups "grpc.io" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/grpc-io/HTFu_G_-7vQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to grpc-io+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/b1eb5da8-a77e-4545-8776-94a716e583a4n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages