Questions tagged [grpc-node]

grpc-node is a high-performance, open-source universal RPC framework for Node.js platform.

gRPC is an open source remote procedure call (RPC) system initially developed at Google. It uses HTTP/2 for transport, Protocol Buffers as the interface description language, and provides features such as authentication, bidirectional streaming and flow control, blocking or nonblocking bindings, and cancellation and timeouts.

grpc-node repository

gRPC Node Quick Start

222 questions
1
vote
0 answers

How can i setup client-side load balancing without using any external service like haproxy?

Haproxy configuration for multiple gprc server is awful and we want to use client-side load balancing but don't know how to do it. I found some files in grpc-node library (like this) related to load balancing, but couldn't find any public api of…
lalalananana
  • 80
  • 1
  • 7
1
vote
1 answer

How to properly re-map types from .proto files to Typescript and vice versa?

Let's imagine I have 2 Nest.js services: Service A and Service B, which communicate using gRPC. I am trying to pass an object of type UserSettings from Service A to Service B via Remote Procedure Call (RPC) Let's imagine in service A we have…
1
vote
0 answers

gRPC (node) Server waits for all RPCs to be handled before sending back responses

The following link contains a detailed description of the issue: https://github.com/grpc/grpc-node/issues/2384 When a server receives multiple RPCs from a client, instead of sending back responses as it processes the requests, it seems to send back…
Ayush Goel
  • 435
  • 6
  • 16
1
vote
0 answers

Can @grpc/grpc-js dynamically unpack google.protobuf.Any type?

I work on a gRPC client using @grpc/grpc-js, and I have to handle application-specific errors by reading the details array of the google.rpc.Status object. Is it possible to dynamically unpack the error object without knowing the possible errors…
kittaakos
  • 149
  • 1
  • 6
1
vote
0 answers

How can I save the grpc reponse in NodeJS?

I create both grpc server and client. But I'm new to Node/TS and don't know how to save the respone in the callback function. function read(path:string): string { logger.info(`reading ${path}`); var request:FileRequest = new FileRequest(); …
1
vote
2 answers

ProtoBuf - Can a field support two possible datatypes?

is it possible for one field in protobuf to support/accept a string or an array of string. This is my message: message MessageA { string fieldId =1; string method = 2; google.protobuf.Any value =3; } The reason for it being dynamic is because…
1
vote
0 answers

google.protobuf.Struct is coming back as just fields in NodeJS

I have the following response message in my proto file via NodeJS. message WorkSpaceResponse{ google.protobuf.Struct workspace = 1; } And below is the service function that sends back the response as: let sample = { "name": "Test…
ololo
  • 1,326
  • 2
  • 14
  • 47
1
vote
1 answer

nestjs grpc client cannot resolve dns to grpc service inside docker container

I have a grpc service and a simple http server serving as a grpc client. They work fine when running locally. However, once put inside separate docker containers, they cannot establish a connection. The grpc service runs and exposes port…
Exanubes
  • 133
  • 2
  • 13
1
vote
0 answers

How to Define a Protobuf Message for Dynamic JSON data for Javascript

I using then gRPC for inter micro service communication. Both the services are written in JavaScript. In the response of the gRPC call I need to send an array for JSON objects, Which contains the nested JSON objects also and data is dynamic in the…
1
vote
0 answers

How to generate constant typescript enums from protobuf?

I have this protobuf code enum Language { en = 0; jp = 1; ar = 2; } When it's generated to typescript the values become Lanuage.en = 0, Language.jp = 1 ... What I want is Language.en = "ENGLISH", Language.ar = "ARABIC" How to achieve this?
rksh1997
  • 1,103
  • 7
  • 17
1
vote
1 answer

Cloud Run - gRPC authentication through service account - NodeJS

I have to make an authenticated request to a Cloud run service which uses HTTP/2 method for communication via grpc. The service returns a signedURL for a file and it does the same successfully, when deployed unauthenticated. I added the JWT token to…
Shobit Jain
  • 308
  • 2
  • 14
1
vote
2 answers

How can I change the grpc.max_receive_message_length configuration in Google Cloud Text to speech on NodeJS?

I am using the package @google-cloud/text-to-speech in order to convert text to speech, using roughly this code: import GoogleTextToSpeech, { SynthesizeSpeechRequest } from '@google-cloud/text-to-speech'; const fs = require('fs'); const path =…
Japser36
  • 194
  • 2
  • 8
1
vote
1 answer

Make gRPC messages JSON serializable

I have a gRPC definition that contains repeated scalar values. For example message Request { bool dryrun = 1; bool verbose = 2; bool enabled = 3; float ratio = 4; int32 count = 5; string somevar = 6; bool withcondition = 7; bool…
kakyo
  • 10,460
  • 14
  • 76
  • 140
1
vote
1 answer

gRPC node-js method not called when protocol specifies void parameter type

I have just recent started experimenting with gRCP and currently trying to see how it works using node-js to create a simple example . However after creating the protocol to be used between both client and server . One of my rpc method is not been…
hebronace
  • 77
  • 8
1
vote
4 answers

NestJS gRPC Unimplemented Streaming Server Method

I'm trying to build microservice with NestJS and gRPC. It has two services, the first one is the gRPC service, and the second one is the REST service that call gRPC service. At first, it works fine on unary call, the findRepoById rpc. But it doesn't…
fahmiduldul
  • 924
  • 7
  • 18