grpc-go | HTTP/2 based RPC
kandi X-RAY | grpc-go Summary
kandi X-RAY | grpc-go Summary
The Go implementation of gRPC: A high performance, open source, general RPC framework that puts mobile and HTTP/2 first. For more information see the Go gRPC docs, or jump directly into the quick start.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of grpc-go
grpc-go Key Features
grpc-go Examples and Code Snippets
Community Discussions
Trending Discussions on grpc-go
QUESTION
ANSWER
Answered 2022-Mar-08 at 07:30The health check meaningful when has multiple server addresses. If only has one address, there is no need to check health status. So the load balance policy round_robin
is work together with health check.
The round_robin
will check health status, so it will send request to READY
address one after another.
The pick_first
policy not support health check, so it will use first success connectted server. So there will only use specify address for any request.
You can read the document of health check and load balance policy in LB Policies Can Disable Health Checking When Needed.
For debug the client and server, you can add environment variable GRPC_GO_LOG_SEVERITY_LEVEL=info
and GRPC_GO_LOG_VERBOSITY_LEVEL=99
for more detail of transport and connection event.
QUESTION
EDIT
It seems that my first error I describe is very easy to reproduce. Actually, Google Run fails to run any GRPC query on a .NET5 GRPC server it seems (at least, it did work before but as of today, February 21st, it seems that something changed). To reproduce:
- Create a .NET5 GRPC server (also fails with .NET6):
ANSWER
Answered 2022-Feb-24 at 08:44It is an actual bug from Envoy and Google Cloud Run. There is a quick fix if you're using .NET6, otherwise it's a bit more hacky. I will just copy here the answer provided by Amanda Tarafa Mas from Google Cloud Platform on the github issue I opened:
Here are the potential fixes:
- When using .NET 6 you can set KestrelServerOptions.AllowAlternateSchemes to true.
- If on a lower .NET version, consider something like GRPC :scheme pseudo-header passed from proxy/loadbalancer causes ConnectionAbortedException dotnet/aspnetcore#30532 (comment). Or consider upgrading to .NET 6.
What's happening:
- Cloud Run has dependency on Envoy, which has a behavior change since 04/15/2021, see "preserve_downstream_scheme" in release notes: https://www.envoyproxy.io/docs/envoy/latest/version_history/v1.18.0 Envoy recently removed the old behaviour: https://www.envoyproxy.io/docs/envoy/latest/version_history/current#removed-config-or-runtime
- In turn, this exposes this .NET issue: GRPC :scheme pseudo-header passed from proxy/loadbalancer causes ConnectionAbortedException dotnet/aspnetcore#30532, for which the Kestrel configuration flag was added, but only for .NET 6. I'm looking into having this documented somewhere. @meteatamel can you update the tutorial so that it uses the Kestrel option?
For me setting KestrelServerOptions.AllowAlternate
was enough to make my GRPC server work again.
As @Craig said, you can track the issue here and see if it gets resolved.
QUESTION
I'm trying to incorporate google-cloud-tasks
Python client within my fastapi app. But it's giving me an import error like this:
ANSWER
Answered 2022-Feb-09 at 17:35After doing some more research online I realized that installation of some packages is missed due to some existing packages. This issue helped me realize I need to reorder the position of google-cloud-tasks
in my requirements.txt. So what I did was pretty simple, created a new virtualenv installed google-cloud-tasks
as my first package and then installed everything else and finally the problem is solved.
Long story short the issue is the order in which packages are installed and that's why some packages are getting missed.
QUESTION
I know that google states that protobufs don't support large messages (i.e. greater than 1 MB), but I'm trying to stream a dataset using gRPC that's tens of megabytes, and it seems like some people say it's ok, or at least with some splitting...
However, when I try to send an array this way (repeated uint32
), it takes like 20 seconds on the same local machine.
ANSWER
Answered 2022-Feb-07 at 02:37If you changed it over to use streams that should help. It took less than 2 seconds to transfer for me. Note this was without ssl and on localhost. This code I threw together. I did run it and it worked. Not sure what might happen if the file is not a multiple of 4 bytes for example. Also the endian order of bytes read is the default for Java.
I made my 10 meg file like this.
QUESTION
Following this example:
gRPC in Google Cloud Run
https://github.com/grpc-ecosystem/grpc-cloud-run-example/blob/master/golang/README.md
I've deployed a gRPC service with reflection on CloudRun.
Using grpcurl for testing: https://github.com/fullstorydev/grpcurl
...ANSWER
Answered 2021-Mar-07 at 21:49gRPC Reflection requires bidirectional streaming, so make sure to check the Enable HTTP/2 option (--use-http2) while deploying. That will enable bi-di streaming.
Also make sure to use the :443 port and authenticate to the server if needed by adding Authentication metadata (see Service-to-Service authentication documentation).
QUESTION
I am having difficulties in writing a python script that generates SSL keys and certificates for GRPC services. I am trying to write a function that can run the commands in this file by having ip passed into it. This is what I wrote, but I receive an error that I do not understand, I will list it at the bottom
My function:
...ANSWER
Answered 2021-Feb-17 at 12:32You are trying to set a shell variable without invoking a shell.
The proper way to do this is to set the variable in your Python script.
QUESTION
I have been trying to upload an image in chunks with client side streaming using grpcurl. The service is working without error except that at the server, image data received is 0 bytes.
The command I am using is:
grpcurl -proto image_service.proto -v -d @ -plaintext localhost:3010 imageservice.ImageService.UploadImage < out
This link mentions that the chunk data should be base64 encode and so the contents of my out file are:
...ANSWER
Answered 2021-Feb-03 at 22:05Interesting question. I've not tried streaming messages with (the excellent) grpcurl
.
The documentation does not explain how to do this but this issue shows how to stream using stdin.
I recommend you try it that way first to ensure that works for you.
If it does, then bundling various messages into a file (out
) should also work.
Your follow-on questions suggest you're doing this incorrectly.
chunk_data
is the result of having split the file into chunks; i.e. each of these base64-encoded strings should be a subset of your overall image file (i.e. a chunk).your first message should be
{ "info": "...." }
, subsequent messages will be{ "chunk_data": "" }
until EOF.
QUESTION
I have used protoreflect to write http-to-gRPC-gateway. But I don't see any easy option to do the reverse - gRPC-to-HTTP-gateway. One of the idea is to expose GRPC to outside but use a custom gateway to invoke internal microservices via MessageQ to avoid loadbalancing, discovery service and may be convert GRPC streaming durable or use reflection to invoke method instead of using generated server stub
Below is what I got so far
...ANSWER
Answered 2021-Jan-13 at 09:29Got it to work, thanks to protoreflect
Working sample without error handling
QUESTION
I am trying to use BigQuery in AI-Platform-Notebooks, but I am running into a ContextualVersionConflict. In this toy example, I am trying to pull two columns worth of data from the BigQuery database entitled bgt_all, in the project job2vec.
...ANSWER
Answered 2021-Jan-05 at 10:19In order to further contribute to the community I am posting the answer based on my comment above.
Firstly, you should try to upgrade the packages using the command:
pip install --upgrade pandas-gbq 'google-cloud-bigquery[bqstorage,pandas]'
Then, instead of using the to_dataframe() method you can use the read_gbq(), which loads data from BigQuery using the environment's default project, as follows:
QUESTION
Inside docker, it seems that I cannot compile my gRPC micro-service due to this error:
...ANSWER
Answered 2020-Sep-07 at 00:39The gist of this error is that the version of binary used to generate the code isn't compatible with the current version of code. A quick and easy solution would be to try updating the protoc-gen-go
compiler and the gRPC library to the latest version.
go get -u github.com/golang/protobuf/protoc-gen-go
then regen the proto
heres a link to a reddit thread that discusses the issue
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install grpc-go
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page