The Go implementation of gRPC: A high performance, open source, general RPC framework that puts mobile and HTTP/2 first.
Questions tagged [grpc-go]
385 questions
42
votes
11 answers
Correct format of protoc go_package?
I have an existing project in Go where I'm using Protocol buffers / gRPC. Until recent the go_package option was optional and the resulting Go package name would be the same as the proto package name.
This file lives in the project root. The…

Tim
- 1,585
- 1
- 18
- 23
27
votes
1 answer
grpc.WithInsecure is deprecated: use insecure.NewCredentials() instead
Hey I'm trying make a small test client with Go and Grpc,
opts := grpc.WithInsecure()
cc, err := grpc.Dial("localhost:9950", opts)
if err != nil {
log.Fatal(err)
}
The WithInsecure() function call gives a…

shwick
- 4,277
- 6
- 21
- 28
25
votes
3 answers
grpc with mustEmbedUnimplemented*** method
Recently, grpc-go introduced the mustEmbedUnimplemented*** method.
It is used for forward compatibility.
In simple terms, I am unable to understand how it is helping and how earlier without it what problems we were facing?
In my structs now I use to…

Parth Wadhwa
- 577
- 1
- 7
- 11
19
votes
2 answers
grpc: received message larger than max (8653851 vs. 4194304)
The problem:
I am getting this error while receiving message in grpc:
rpc error: code = ResourceExhausted desc = grpc: received message larger than max (8653851 vs. 4194304)
What I tried:
I gave the option to increase the size of the message to be…

Satyajit Das
- 2,740
- 5
- 16
- 30
16
votes
1 answer
Handling Context Cancelled errors
I am new to Go and still learning it every signle day. I see a lot of context cancelled error in our project which is kind of annoying me. So i was thinking to dig a little deeper to figure out whats going on.
If I am not wrong, in "simple" terms,…

Em Ae
- 8,167
- 27
- 95
- 162
14
votes
1 answer
Differences between protoc-gen-go and protoc-gen-go-grpc
I'm a bit confused about protoc-gen-go vs protoc-gen-go-grpc. I know that:
protoc-gen-go contains that code for the serialization/deserialization of protobuf messages
protoc-gen-go-grpc contains the code for gRPC Server and Client
But, I'm using…

user8285681
- 543
- 4
- 12
13
votes
2 answers
protoc --go_opt=paths=source_relative vs --go-grpc_opt=paths=source_relative
I am having a hard time figuring out protoc command and go plugin.
What is the different between:
protoc \
# Directory where you want the compiler to write your Go output.
--go_out=.
# vs ?
--go_opt=paths=source_relative
# vs ?
…

Chris G.
- 23,930
- 48
- 177
- 302
11
votes
4 answers
How to generate swagger3 (OpenAPI3) spec in (.json/.yaml) from protobuf (.proto) files?
My original use-case:
I am building an application in GO with a gRPC server (using protobuf), and wrapping it inside an HTTPS server (using gin). Only the HTTPS server is being published to the clients for use (by which I mean that my application…

Krishna Birla
- 332
- 2
- 10
10
votes
3 answers
grpc organization in microservices
I'm creating a system using a microservices architecture. There are two microservices A and B, each living in their own repository.
There is a user.proto file containing protobuf definition and gRPC method signatures. A uses generated user.pb.go as…

kkyr
- 3,785
- 3
- 29
- 59
10
votes
2 answers
GRPC Connection Management in Golang
I am relatively new to GRPC and want to be sure that I am doing connection management correctly with golang. I don't want to have to create a new connection for every call but I also don't want to create bottlenecks as I scale.
What I did was to…

mornindew
- 1,993
- 6
- 32
- 54
9
votes
2 answers
How does gRPC client-streaming flow control work in go?
I would like to know, how flow control works in a client-streaming gRPC service in Go.
Specifically, I am interested in knowing when will a call to stream.SendMsg() function in the client-side block? According to the documentation :
SendMsg()…

kfertakis
- 127
- 1
- 5
8
votes
1 answer
Go GRPC Refresh token for a bidirectional stream
TLDR: I am looking for a way to update headers on an open stream for each call to stream.Send(msg) without closing the stream and opening a new one.
Summary
I have a GRPC client and server built to handle bidirectional streams. To authenticate with…

Trevor Johnson
- 874
- 5
- 19
8
votes
0 answers
Go GRPC Bidirectional Stream Performance
We are developing a high frequency trading platform and in one of our components we have implemented the grpc with golang. And we needed to use bidirectional streaming in one of our usecases , we made a sample implementation as in below code ,…

tolgatanriverdi
- 561
- 9
- 31
8
votes
3 answers
How can I get the client IP address and user-agent in Golang gRPC?
I set up a series of gRPC requests and responses which all work fine, but I'm stuck when I try to get the client IP address and user-agent who is calling my gRPC APIs.
I read the Go gRPC documentation and other sources, but didn't find much valuable…

Felix
- 113
- 1
- 1
- 5
7
votes
2 answers
Solving protoc-gen-go: unable to determine Go import path problem by adding a "M" argument
Same symptom as protoc-gen-go: unable to determine Go import path for "simple.proto"
For simple proto file with following content.
syntax="proto3";
package main;
message Person {
string name = 1;
int32 age = 2;
}
I am trying to…

xpt
- 20,363
- 37
- 127
- 216