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
23
votes
1 answer

Are channel/stubs in gRPC thread-safe

When using gRPC from Java, can I cache stubs (clients) and call them in a multi-threaded environment or are the channels thread-safe and can be safely cached? If there is a network outage, should I recreate the channel or it is smart enough to…
julius
  • 815
  • 2
  • 7
  • 12
22
votes
1 answer

How do I generate .proto files or use 'Code First gRPC' in C#

I want to use gRPC with .NET in an asp.net core web application. How do I generate the necessary .proto file from an existing C# class and model objects? I don't want to re-write a .proto file that mirrors the existing code, I want the .proto file…
jjxtra
  • 20,415
  • 16
  • 100
  • 140
22
votes
2 answers

How to assert gRPC error codes client side in Go

Given the following gRPC server side code: import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" .... ) .... func (s *Router) Assign(ctx context.Context, req *api.Request(*api.Response, error) { return nil,…
Myles McDonnell
  • 12,943
  • 17
  • 66
  • 116
22
votes
5 answers

How to convert Google proto timestamp to Java LocalDate?

We need to convert Google Proto buffer time stamp to a normal date. In that circumstance is there any way to convert Google Proto buffer timestamp to a Java LocalDate directly?
Thirunavukkarasu
  • 361
  • 1
  • 2
  • 13
22
votes
2 answers

Why do we need to register reflection service on gRPC server

I was going through this code of gRPC server. Can anyone tell me the need for reflection used here Code : func main() { lis, err := net.Listen("tcp", port) if err != nil { log.Fatalf("failed to listen: %v", err) } s :=…
Naresh
  • 5,073
  • 12
  • 67
  • 124
22
votes
3 answers

gRPC client side load balancing

I'm using gRPC with Python as client/server inside kubernetes pods... I would like to be able to launch multiple pods of the same type (gRPC servers) and let the client connect to them (randomly). I dispatched 10 pods of the server and setup a…
Idan
  • 2,819
  • 4
  • 33
  • 61
22
votes
4 answers

How should a GRPC Service be hosted?

I have created a GRPC Server in C# using the example given at Link. Now I want to figure out as how should I be hosting this server so that I achieve following: Should I make this Server a Console application or a a Windows Service. If I make it a…
GawdePrasad
  • 623
  • 1
  • 7
  • 15
22
votes
3 answers

Can both ends of a gRPC connection accept method calls?

From the introduction on gRPC: In gRPC a client application can directly call methods on a server application on a different machine as if it was a local object, making it easier for you to create distributed applications and services. As in many…
user142162
21
votes
5 answers

protoc-gen-js: program not found or is not executable

Trying to compile my protos - I need to compile them to use in my react app. But I get this error. I run the command as follows: cd src/main/proto && protoc -I=. *.proto --js_out=import_style=commonjs:.…
Asma Rahim Ali Jafri
  • 1,173
  • 2
  • 15
  • 22
21
votes
1 answer

grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with: status = StatusCode.UNAVAILABLE

I have written a simple GRPC service, client code in python. Sometimes out of nowhere, the client fails with the following error: Traceback (most recent call last): File "grpc_client.py", line 35, in response =…
Zabir Al Nazi
  • 10,298
  • 4
  • 33
  • 60
21
votes
3 answers

Python not able to connect to grpc channel -> "failed to connect to all addresses" "grpc_status":14

I'm getting the error below when trying to call a stub method. Any idea what is causing it? [bolt.api.handlers] 2019-08-21 20:07:57,792 ERROR handlers:1066: 'ResourceHandler' object has no attribute 'ontology_service_handler' Traceback (most…
Yonoss
  • 1,242
  • 5
  • 25
  • 41
21
votes
3 answers

Duplicate class in protobuf lite and protobuf java

I'm using grpc with protobuf lite in android implementation. but protobuf lite doesn't have google time stamp, and my protos has import "google/protobuf/timestamp.proto". so i added implementation 'com.google.protobuf:protobuf-java:3.7.1' to gradle…
sahar
  • 323
  • 1
  • 2
  • 5
21
votes
3 answers

Create variable of type Map[string]interface{} in gRPC protoc buffer golang

I'm using grpc golang to communicate between client and server application. Below is the code for protoc buffer. syntax = "proto3"; package Trail; service TrailFunc { rpc HelloWorld (Request) returns (Reply) {} } // The request message…
Radhika.S
  • 355
  • 1
  • 2
  • 8
21
votes
1 answer

gRPC: What is the recommended way to shut down an asynchronous server in C++?

I have a gRPC server that hosts two asynchronous services ("Master" and "Worker"), and I would like to implement graceful shutdown for the server. Each service has its own grpc::CompletionQueue. There appear to be two Shutdown() methods that might…
mrry
  • 125,488
  • 26
  • 399
  • 400
20
votes
2 answers

How do you create a gRPC client in .NET Framework?

I followed the instructions at: https://learn.microsoft.com/en-us/aspnet/core/tutorials/grpc/grpc-start?view=aspnetcore-3.1&tabs=visual-studio to create a gRPC service and client in .NET Core and everything worked great. Next, I need to have a…
Rich Shipley
  • 317
  • 1
  • 2
  • 6