grpc-java

How to pass on a traceId from gRPC's context to another thread/threadPool?

拟墨画扇 提交于 2021-01-01 05:04:46
问题 I am using grpc-java and have 3 services, A, B and C. I call service A and then service A calls B and C. I am using Hystrix in the calls to B and C. C in turn spawns another thread to call another service. I have ClientInterceptors and ServerInterceptors which passes around the traceId. I can see the traceIds in the Context and logs as long as it is a gRPC worker thread but lose them when the call moves to another thread - RxIoScheduler thread or Hystrix thread. How do I pass the traceId

gRPC Android Client losing connection “too many pings”

老子叫甜甜 提交于 2020-07-19 11:28:10
问题 Android grpc client is receiving GOAWAY from server with "too many pings" error. Now I realise that this is probably a server side issue, but I think the issue is that the client channel settings do not match that of the servers. I have a C# gRPC server with the following settings: List<ChannelOption> channelOptions = new List<ChannelOption>(); channelOptions.Add(new ChannelOption("GRPC_ARG_HTTP2_MIN_RECV_PING_INTERVAL_WITHOUT_DATA_MS", 1000)); channelOptions.Add(new ChannelOption("GRPC_ARG

gRPC: Random CANCELLED exception on RPC calls

£可爱£侵袭症+ 提交于 2020-06-16 02:22:10
问题 I'm occasionally getting cancellation errors when calling gRPC methods. Here's my client-side code (Using grpc-java 1.22.0 library): public class MyClient { private static final Logger logger = LoggerFactory.getLogger(MyClient.class); private ManagedChannel channel; private FooGrpc.FooStub fooStub; private final StreamObserver<Empty> responseObserver = new StreamObserver<>() { @Override public void onNext(Empty value) { } @Override public void onError(Throwable t) { logger.error("Error: ", t)

How to implement com.google.protobuf.BlockingRpcChannel for gRPC generated Java code?

风格不统一 提交于 2020-03-25 21:59:29
问题 I recently took a proto file representing a gRPC service and generated Java code from it. However, all the interfaces expect a com.google.protobuf.BlockingRpcChannel and I don't have any idea on how to create it. When I look at example, I see people using io.grpc.ManagedChannel but that is because the generated Java code used that type instead. I'm not sure if it's because i'm using a specific version of protobuf or what? public static BlockingInterface newBlockingStub(com.google.protobuf

How to log client connection to server for gRPC?

孤人 提交于 2020-01-23 03:38:05
问题 How to log client connection to server for gRPC ? That is on event when a client is connected, I should be able to get some basic information, like IP, version and log it DATETIME connection from 192.168.1.1 AppName Related to gRPC / Protobuf interface versioning 回答1: Today, IP address and version is available on a per-RPC basis, but not when the client connects. You can use serverCall.attributes().get(Grpc.TRANSPORT_ATTR_REMOTE_ADDR) to get the IP address and the version is included in the

EnvoyFilter filter for grpc_json_transcoder in istio

a 夏天 提交于 2020-01-14 05:36:26
问题 istio EnvoyFilter is not converting http1X to http2X(GRPXC) service I gave GRP Service in Azure AKS and istio-1.1.6 my GRPC service is listening 50051 port , I have EnvoyFilter filter for trascoding of JSON to GRPC but on my service I am still getting http 1X request even I am calling it through GRPC Client (Http2.o) request Envoy Filer apiVersion: networking.istio.io/v1alpha3 kind: EnvoyFilter metadata: name: envoy-proxy namespace: istio-system spec: filters: - listenerMatch: listenerType:

gRPC Java File Download Example

可紊 提交于 2020-01-13 03:23:20
问题 I am looking for a way on how to implement file download functionality using gRPC but I can't find in the documentation how this is done. What is an optimal way to do this? I wanted to have a gRPC server that holds files and a gRPC client to request something from gRPC. I have looked at the examples in Java but could not figure out a way on how to do this. I just started reading about gRPC today. 回答1: You must define a specific message as data container and you must transfer it to the client

Problem returning stream of responses from gRPC service to RESTful client

天涯浪子 提交于 2020-01-05 06:59:10
问题 I am attempting to write a set of services that will provide a REST interface to external clients, while using gRPC/protobuf for inter-service communication internally. Spring Boot is being utilized to help with the background infrastructure support. I only started learning and working with Google protobuf and gRPC about a week ago. I have been able to successfully get simpler processing to work from end-to-end, but these are returning a single object (i.e. no streaming ). I'm having a