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
2
votes
1 answer
gRPC client-side streaming with initial arguments
I'm creating client side streaming method which proto file definition should be looking similar to this:
service DataService {
rpc Send(stream SendRequest) returns (SendResponse) {}
}
message SendRequest {
string id = 1;
bytes data =…

Milos
- 1,353
- 2
- 18
- 37
2
votes
0 answers
How to pass request context to GRPC Go endpoints from Ruby
I'm calling GRPC endpoints from Ruby.
The proto endpoints are for example rpc SayHello (HelloRequest) returns (HelloReply), and implemented in Go, so they take context when calling from Go. The generated client supports client.SayHello(ctx…

onepiece
- 3,279
- 8
- 44
- 63
2
votes
1 answer
Unable to connect to gRPC server in Kubernetes cluster, but can connect when I port-forward [Connection refused]
Been stuck on this error for the past few days!
I have an HTTP server that is meant to connect with the gRPC server through the client. It works fine on my local machine when I start the gRPC server and start my HTTP server. However, When I try to…

Toby
- 21
- 4
2
votes
1 answer
protobuf with grpc for Go in split packages
I'm trying to make my Go project using hexagonal architecture as described here.
In my project I'm using a gRPC communication generated with protoc from .proto file.
The directories structure:
|- grpc.proto
|-internal
|-core
|-domain
…

Dysproz
- 165
- 8
2
votes
1 answer
gRPC service definitions: containerize .proto compilation?
Let's say we have a services.proto with our gRPC service definitions, for example:
service Foo {
rpc Bar (BarRequest) returns (BarReply) {}
}
message BarRequest {
string test = 1;
}
message BarReply {
string test = 1;
}
We could compile…

Max
- 9,220
- 10
- 51
- 83
2
votes
1 answer
How to set Strict-Transport-Header for GRPC services
I was checking Strict Transport Header which Http endpoint serving to UI enables.
Does it make sense to have the headers in the GRPC services not exposed to internet or serving to UI directly?
If so, what will be the way to enable Strict Transport…

Kallol
- 302
- 4
- 16
2
votes
1 answer
Monorepo: How to consume a package from another project?
I am trying to create my first monorepo in Go. The project structure looks as follows:
As you can see on the picture, the monoplay folder is the root.
The pb folder contains the generated gRPC code that I would like to consume in the…

softshipper
- 32,463
- 51
- 192
- 400
2
votes
1 answer
How am I supposed to use protoc-gen-go-grpc?
I am trying to generate Go code for some Protocol Buffers as well as a gRPC service.
In the past I have used https://github.com/golang/protobuf with a generate command that looked something like this:
//go:generate protoc --proto_path=. --go-out=.…

Nick Corin
- 2,214
- 5
- 25
- 46
2
votes
1 answer
What is the difference between grpc.WithConnectParams.Backoff and grpc_retry.WithBackoff?
I am trying to understand what is the difference between two GRPC ways to do a retry.
One is grpc.WithConnectParams; that is, let's say
grpc.Dial(address, grpc.WithConnectParams(grpc.ConnectParams{
Backoff: backoff.Config{
BaseDelay: 1 *…

Karel Bílek
- 36,467
- 31
- 94
- 149
2
votes
2 answers
What is the difference between NettyChannelBuilder and ManagedChannelBuilder
I am trying to understand the difference between ManagedChannelBuilder and NettyChannelBuilder. I came across this question but it only mentions details related to TLS configurations. Can someone explain the basic difference between the…

Shubham Sharma
- 41
- 1
- 6
2
votes
2 answers
google.protobuf.Any field with grpc is always nil
I am using gRPC with golang. I have a very simple proto definition and a gRPC service. The proto definition has a field in Endorsement of type google/protobuf/any. gRPC service is unable to map this field to input value and it's always getting…

Nitish Bhardwaj
- 1,113
- 12
- 29
2
votes
2 answers
Elegant way to handle goroutine in IO wait state in GRPC
Our server (grpc-gateway + grpc) is running on K8S with go 1.13, and terminate stack information
Last State: Terminated
Reason: Error
Message: o.(*Reader).fill(0xc002ec78c0)
…

zangw
- 43,869
- 19
- 177
- 214
2
votes
1 answer
grpc server and gateway shutdown order
my gRPC service uses grpc-gateway to serve http requests.
in order to make the service shutdown gracefully, is there an order i need to pay attention to? i.e. is the shutdown order
A. gRPC service -> gateway
B. gateway -> gRPC service
the only…

kimmy
- 21
- 1
2
votes
0 answers
How to use gRPC with golang echo framework?
I am trying to perform inter-service communication between microservices. I followed the documentation and it was successful. Then, I tried to establish the same with echo framework. But that gives me an invalid memory address when trying to call…

RisingGeek
- 83
- 1
- 9
2
votes
1 answer
Creating grpc client request with repeated fields
I have proto file like this:
message StartAssignmentRequest {
string additional_comment = 3;
repeated RideSlip slips = 4;
}
message RideSlip{
string slip_name = 2;
string slip_ext = 3;
string slip_link = 4;
}
Now I want to create its…

Ninja
- 241
- 2
- 3
- 13