gRPC example in Docker

gRPC example protocol buffers; As we all know, gRPC service is defined using protocol buffers; If you want to know how to define a .proto file, you can go to [protocol buffer Developer Guide](https://developers.google.com/protocol-buffers/docs/overview), Here is our stream_algorithm.proto defination: syntax = "proto3"; // Interface exported by the server. service MyAlgorithmBrain { //get the rank of the item in real time rpc MyRankOfStream(stream ItemRequest) returns (ItemResponse){} //get the structure of the sketch maintained in server rpc SketchOfStream(stream ItemRequest) returns (ItemResponse){} } message ItemRequest { int32 id = 1; int32 value = 2; string timestamp = 3; } message ItemResponse { float rank = 1; } Generate gRPC code Next we need to update the gRPC code used by our application to use the new service definition....

March 19, 2018 · 3 min · 580 words · Me