Testing a gRPC service

I think you’re looking for the google.golang.org/grpc/test/bufconn package to help you avoid starting up a service with a real port number, but still allowing testing of streaming RPCs. import “google.golang.org/grpc/test/bufconn” const bufSize = 1024 * 1024 var lis *bufconn.Listener func init() { lis = bufconn.Listen(bufSize) s := grpc.NewServer() pb.RegisterGreeterServer(s, &server{}) go func() { if err … Read more

How to create GRPC client directly from protobuf without compiling it into java code

Protobuf systems really need protoc to be run. However, the generated code could be skipped. Instead of passing something like –java_out and –grpc_java_out to protoc you can pass –descriptor_set_out=FILE which will parse the .proto file into a descriptor file. A descriptor file is a proto-encoded FileDescriptorSet. This is the same basic format as used with … Read more