gRPC connection between two microservices

54 views
Skip to first unread message

SHEFALI SINGH

unread,
Apr 7, 2021, 1:27:03 AM4/7/21
to grpc.io
Hi,
I am trying to implement a gRPC connection between two microservices, The proto message looks something like this:

message DataMap {
     message Row {
           map<string, google.protobuf.Any> map = 1;
     }
     map<string, string> headers = 1;
     repeated Row rows = 2;
}

The server microservice accepts this structure of data from the client microservice and internally uses a library that requires the data to be in the form of java util Lists and not protobuf lists. Due to the process of conversion of this protobuf list to the util list, I have to iterate over the data set and the server takes extra time due to which the performance of the connection decreases. Is there any way in which I can get the java util list from the protobuf list without iterating over the entire data set?

Thank you!
Shefali

zda...@google.com

unread,
Apr 7, 2021, 1:42:39 PM4/7/21
to grpc.io

The DataMap.getRowsList() should return a java.util.List<Row> already. Did you mean to convert java.util.List<Row> to java.util.List<Map<String, Object>>? I'm afraid there is no better way than iterating over the data. 
Reply all
Reply to author
Forward
0 new messages