Questions tagged [grpc-python]

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

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 Basics - Python

401 questions
0
votes
0 answers

python: generated grpc and protobuf files don't stay in current directory

I have two .proto schema file with the following directives: // vendor_interface.proto syntax = "proto3"; package vendor.name.int.v1; import "google/protobuf/timestamp.proto"; ... and // vendor_interface_api.proto syntax = "proto3"; …
Mark
  • 6,052
  • 8
  • 61
  • 129
0
votes
0 answers

Can we do grpc calls inside an AWS Lambda func?

I am trying to call the stable diffusion API from an AWS Lambda and I get the following error : [INFO] 2022-09-21T22:17:51.365Z Opening channel to grpc.stability.ai:443 [INFO] 2022-09-21T22:17:51.368Z Channel opened to…
0
votes
1 answer

Python grpc: AttributeError 'NoneType' object has no attribute 'unary_unary'

My first time playing around with Python and grpc. I have been troubleshooting for a while now and cant seem to get past the below issue. I am getting the following error by running: venv/bin/python placeholder.py (excuse the file name Im still…
New2Python
  • 325
  • 1
  • 4
  • 17
0
votes
2 answers

share variable that change after import between main process and child processes

I've a project in gRPC where the main.py spawns grpc servers as subprocesses. Also in the project I've settings.py that contains some configurations, like: some_config = {"foo": "bar"} In some files (used by different processes) I have: import…
nscode
  • 147
  • 1
  • 9
0
votes
1 answer

Use KrakenD CE + python 3.xx for gRPC-backend and manipulate responses from two or more backends

I am using a KrakenD community edition to implement an aggregator pattern where an endpoint: /abc is sent to KrakenD API gateway that will call the end-points /a, /b & /c. It will then combine the respective responses and return to /abc. The issue…
0
votes
1 answer

Python grpc fail : PicklingError: Can't pickle : import of module demo_pb2 failed

It is not possible to import python modules generated by protobuf. Here's the code. error message here is the error message after run python main.py. # python main.py Traceback (most recent call last): File…
iskylite
  • 1
  • 1
0
votes
0 answers

Will gRPC automatically start supporting HTTP/3 protocol or will coders/developers have to make changes?

The question is self-explanatory. I'd like to ask if the libraries for C++, Python, etc. will of gRPC will automatically use HTTP/3 once it's introduced?
0
votes
0 answers

how to create skeleton rpc error for pytest

so, I'm paching a method in pytest and I want to it to return rpc error with custom status code and message. I tried my_error = grpc.RpcError() my_error.code = ??? my_error.details = ??? so, there's no constructor for RpcError, so, I was wondering…
0
votes
0 answers

how Python gRPC stream server spawn two clients that connect other same gRPC server

1、proto service RouteGuide { rpc RouteChat(stream RouteNote) returns (stream RouteNote) {} } message RouteNote { // The location from which the message is sent. Point location = 1; // The message to be sent. string message =…
iskylite
  • 1
  • 1
0
votes
1 answer

How to parse a nested protobuf message, python

I created the following protobuf object: message House { message Room { message Attributes { string bed = 1; string desk = 2; } } message Kitchen { message Attributes { string…
0
votes
1 answer

How to configure `MAX_CONNECTION_AGE` on Python gRPC server?

I noticed that a maintainer of gRPC suggested using MAX_CONNECTION_AGE to load balance long lived gRPC streams in their video, Using gRPC for Long-lived and Streaming RPCs - Eric Anderson, Google. I also found an implemented proposal which only…
Ben Butterworth
  • 22,056
  • 10
  • 114
  • 167
0
votes
1 answer

how to run grpc client in python and server in cpp?

I am trying to work with client.py , server.cpp and a make file. I am not understanding how to run the files and work on grpc with these files. Is it possible for anyone to help me understand this concept and work with the client, server and…
Vsdm in
  • 25
  • 4
0
votes
1 answer

I want to use "." in message field name of .proto file

I defined .proto file like: syntax = "proto3"; message networkSliceArray { int32 DRB.UEThpDl.SNSSAI = 1; int32 DRB.UEThpUl.SNSSAI = 2; string networkSliceIdentifier = 3; } I want to parse such type of file. is it possible? or if not…
0
votes
1 answer

My gRPC client could not connect to my Containerised gRPC Server hosted on the same machine

I am implementing a gRPC client and server application where my gRPC server is containerised. The idea is to use Unix domain sockets to communicate between the client and the server. My application was working fine until I had my server was not…
user1606191
  • 551
  • 2
  • 6
  • 14
0
votes
1 answer

how we can parse proto file if it having "." and "-" sign

I create one proto file using java and another using python when I put "." and "-" sign in proto file message field name it shows error that is "missing field number". I m not able to parse that file. and if proto file not accept this character…