Questions tagged [grpc]

A general RPC (Remote Procedure Call) framework over HTTP/2, initially developed at Google. gRPC is a language neutral and platform neutral framework that allows users to write applications where independent services can work with each other as if they were native. It uses Protocol Buffers as the interface description language.

Links

Related Tags

6316 questions
46
votes
2 answers

protoc not generating service stub files

I have just started playing with google proto. When I try to compile proto file present in proto-java example, it does not generate any grpc file. proto…
Raman Sonkhla
  • 461
  • 1
  • 4
  • 3
43
votes
14 answers

protoc-gen-go-grpc: program not found or is not executable

go version: go version go1.14 linux/amd64 go.mod module [redacted] go 1.14 require ( github.com/golang/protobuf v1.4.0-rc.2 google.golang.org/grpc v1.27.1 google.golang.org/protobuf v1.20.0 // indirect ) I am running the following…
Ayush Gupta
  • 8,716
  • 8
  • 59
  • 92
42
votes
6 answers

How to debug grpc call?

I'm trying to figure out why my grpc call isn't working, but I can't figure out how to turn on debugging, so I can see the data that's being sent and received over the grpc connection. How do you turn on debugging for grpc calls?
jerjou
  • 1,376
  • 1
  • 10
  • 10
38
votes
9 answers

golang protobuf remove omitempty tag from generated json tags

I am using google grpc with a json proxy. for some reason i need to remove the omitempty tags from the struct generated in the *.pb.go files. if i have a proto message like this message Status { int32 code = 1; string message = 2; } The…
sadlil
  • 3,077
  • 5
  • 23
  • 36
37
votes
2 answers

How to share Protobuf definitions for gRPC?

Since you have to share .proto files to define data and services for gRPC, service provider and clients need to access the same .proto files. Is there any common strategy to distribute these files? I want to avoid that every project has its own…
Milgo
  • 2,617
  • 4
  • 22
  • 37
37
votes
3 answers

How are protocol-buffers faster than XML and JSON?

I recently started reading and employing gRPC in my work. gRPC uses protocol-buffers internally as its IDL and I keep reading everywhere that protocol-buffers perform much better, faster as compared to JSON and XML. What I fail to understand is -…
gravetii
  • 9,273
  • 9
  • 56
  • 75
37
votes
9 answers

How to add global exception interceptor in gRPC server?

In gRPC , how to add a global exception interceptor that intercepts any RuntimeException and propagate meaningful information to the client ? for example , a divide method may throw ArithmeticException with / by zero message . In the server side , I…
smallufo
  • 11,516
  • 20
  • 73
  • 111
36
votes
1 answer

does grpc service must have exactly one input parameter and one return value

let's say i have a proto file like this. can I define service like this rpc SayHello () returns (Response) {} //service has no input rpc SayHello (Request1,Request2) returns (Response) {}//service has two inputs //.proto file syntax =…
lcm
  • 531
  • 1
  • 5
  • 6
35
votes
6 answers

Protocol Buffer imports not recognized in Intellij

I am attempting to import one protocol buffer message into another, but the imports are not recognized. As long as I don't try to import one protobuf into another, the protobuf code is generated (in java), the code compiles and runs as expected. I'm…
L. Blanc
  • 2,150
  • 2
  • 21
  • 31
35
votes
3 answers

Docker build taking too long when installing grpcio via pip

I have a Dockerfile which installs a few packages via pip. Some of them are requiring grpcio, and it takes a few minutes only to build this part. Does anyone have a tip to speed up this part? Installing collected packages: python-dateutil,…
Indigo Ping
  • 418
  • 1
  • 4
  • 8
34
votes
4 answers

Is "google/protobuf/struct.proto" the best way to send dynamic JSON over GRPC?

I have a written a simple GRPC server and a client to call the server (both in Go). Please tell me if using golang/protobuf/struct is the best way to send a dynamic JSON with GRPC. In the example below, earlier I was creating Details as a…
Anuj Gupta
  • 341
  • 1
  • 3
  • 6
34
votes
2 answers

gRPC + Image Upload

I want to create a simple gRPC endpoint which the user can upload his/her picture. The protocol buffer declaration is the following: message UploadImageRequest { AuthToken auth = 1; // An enum with either JPG or PNG FileType image_format…
Nate Lee
  • 2,842
  • 1
  • 24
  • 30
33
votes
9 answers

Why do I get this GRPC Error "WARNING: EmulatorService.cpp:448: Cannot find certfile" when I start the emulator?

Good evening everyone, I have only been dealing with Java and Android Studio for a few months, can someone help me to solve this error? It occurs every time the emulator starts. Thank you Emulator: Started GRPC server at 127.0.0.1:8554 Emulator:…
user12927500
31
votes
3 answers

Cannot connect to Go GRPC server running in local Docker container

I have a go grpc service. I'm developing on a mac, sierra. When running a grpc client against the service locally, all is well, but when running same client against same service in the docker container I get this error: transport:…
david webber
  • 518
  • 1
  • 5
  • 13
29
votes
3 answers

Raising a server error to the client with grpc

Let's consider a simple service: service Something { rpc Do(Request) returns Response; } message Request { string field = 1; } message Response { string response = 1; } Assume I have to do some checking on the Request.field, I want…
FunkySayu
  • 7,641
  • 10
  • 38
  • 61