Questions tagged [grpc-go]

The Go implementation of gRPC: A high performance, open source, general RPC framework that puts mobile and HTTP/2 first.

385 questions
7
votes
1 answer

Connect C# GRPC client to Go Server

I'm attempting to connect to a Go GRPC Server from a C# Client but the client channel is failing to connect to the server. I would expect that there should be no issues in connecting to a GRPC server that is written and hosted by Go and a client…
Stephen Ross
  • 882
  • 6
  • 21
7
votes
2 answers

GRPC Message Structures

I am in the process of migrating a legacy application (bit of microservices and monolith) into using GRPC. The entire code base is currently in GO. I have started to model my messages and they are looking very similar to my structs that I am using…
mornindew
  • 1,993
  • 6
  • 32
  • 54
7
votes
2 answers

How to identify a disconnected client in gRPC?

I am building an API using gRPC and in server side, I want to receive a notification when a client disconnects, identify it and perform some tasks based on that. So far, I was able to detect client disconnection using grpc.StatsHandler method…
6
votes
2 answers

gRPC Context cancellation propogation

I am trying to understand how Go context cancellation works underneath in client service communication (say, any gRPC API call ). Let's say a client canceled the context on its end. Does it result in a new HTTP request to the server communicating…
Vishal
  • 635
  • 4
  • 9
6
votes
1 answer

How to implement gRPC gateway mux handler to handle multiple http methods

I have REST HTTP handlers implemented with gorilla/mux. I am trying to migrate them into gRPC. There are some handlers doing file upload and download. So, my client decided to implement those handlers in gRPC gateway. One of my mux handler handles…
nipuna
  • 3,697
  • 11
  • 24
6
votes
2 answers

Why grpc-go can run grpc server and http server at the same address and port, but grpc-node cannot

I had read this answer: https://stackoverflow.com/a/56943771/6463558, it says that there is no way to run gRPC server and HTTP server at same address and port using grpc-node package. But I can create gRPC server and HTTP server at same address and…
Lin Du
  • 88,126
  • 95
  • 281
  • 483
6
votes
2 answers

Passing custom proto message using WithDetails() from gRPC status package

I have been recently experimenting with gRPC error handling and wanted to pass in my own proto message to the client (defining my own error details and internal error codes). After searching around, found out couple of examples that uses…
pkumarn
  • 1,383
  • 4
  • 22
  • 29
6
votes
1 answer

protobuf import google/protobuf/timestamp.proto

My proto file is: syntax = "proto3"; import "google/protobuf/timestamp.proto"; service Foo { rpc now(NowRequest) returns (NowResponse) {} } message NowRequest {} message NowResponse { google.protobuf.Timestamp now = 1; } My command to…
user2133814
  • 2,431
  • 1
  • 24
  • 34
6
votes
2 answers

is a nil server message possible with gRPC?

In the following gRPC-client code, is the second if necessary? status, err := cli.GetStatus(ctx, &empty.Empty{}) if err != nil { return err } if status == nil { // this should NEVER happen - right? return fmt.Errorf("nil Status result…
colm.anseo
  • 19,337
  • 4
  • 43
  • 52
5
votes
2 answers

automatic gRPC unix reconnect after EOF

I have an application (let's call it client) connecting to another process (let's call it server) on the same machine via gRPC. The communication goes over unix socket. If server is restarted, my client gets an EOF and does not re-establish the…
gtatr
  • 6,947
  • 1
  • 17
  • 27
5
votes
4 answers

How to open a secure channel in python gRPC client without a client SSL certificate

I have a grpc server (in Go) that has a valid TLS certificate and does not require client side TLS. For some reason I can not implement the client without mTLS in Python, even though I can do so in Golang. In Python I…
prnvbn
  • 700
  • 2
  • 7
  • 25
5
votes
2 answers

How to mock a dummy grpc service with methods in Go

I need to write a unit test for a function, which in its source code calls a gRPC method of a different gRPC service. My test results in a panic error because that gRPC service is not running on my machine. I want to create a dummy service in my…
Sruthi CP
  • 341
  • 3
  • 13
5
votes
3 answers

Golang grpc.server: Understanding notions of server, and services

I am trying to understand the notions of Listener, Server and Services in the context of gRPC, Protobuf. Let's use example on https://grpc.io/docs/languages/go/basics/ as a reference. Here we have Listener: lis gRPC Server: grpcServer :=…
sam
  • 777
  • 2
  • 6
  • 19
5
votes
0 answers

Log from withing gRPC/Go handlers

I am trying to debug code by printing/logging from within a gRPC/Go function but the output does not print to the terminal. fmt.Println() works in my main() method, but not in the server callbacks. How can I print from within these gRPC handlers?…
Coder1
  • 13,139
  • 15
  • 59
  • 89
5
votes
2 answers

How to make Protobuf 3 fields mandatory?

I'm writing my first API endpoint in GoLang using GRPC/proto-buffers. I'm rather new to GoLang. Below is the file I'm writing for my test case(s) package my_package import ( "context" "testing" "github.com/stretchr/testify/require" …
Saqib Ali
  • 11,931
  • 41
  • 133
  • 272
1
2
3
25 26