grpc-java

Connection Error io.netty.handler.codec.http2.Http2Exception: HTTP/2 client preface string missing or corrupt. Hex dump for received bytes:

只谈情不闲聊 提交于 2021-02-18 10:59:38
问题 Working on Grpc Bidirectional Streaming, when i try to run grpc, getting below error Connection Error io.netty.handler.codec.http2.Http2Exception: HTTP/2 client preface string missing or corrupt. Hex dump for received bytes: at io.netty.handler.codec.http2.Http2Exception.connectionError(Http2Exception.java:82) at io.netty.handler.codec.http2.Http2ConnectionHandler$PrefaceDecoder.readClientPrefaceString(Http2ConnectionHandler.java:322) at io.netty.handler.codec.http2.Http2ConnectionHandler

GRPC - nodejs DNS resolution failed

ぐ巨炮叔叔 提交于 2021-02-08 06:57:21
问题 I'm working with a GRPC service hosted with HTTPS and self-signed cert. When I connect using syntax like: const client = new productService('https://grpc-server-xxx.com:9090', grpc.credentials.createInsecure()) I am getting the error like this { Error: 14 UNAVAILABLE: DNS resolution failed at Object.exports.createStatusError (C:\grpc\node_modules\grpc\src\common.js:91:15) at Object.onReceiveStatus (C:\grpc\node_modules\grpc\src\client_interceptors.js:1209:28) at InterceptingListener._callNext

How to create GRPC client directly from protobuf without compiling it into java code

孤人 提交于 2021-02-08 06:29:14
问题 When working with GRPC, we need to generate the gRPC client and server interfaces from our .proto service definition via protocol buffer compiler (protoc) or using Gradle or Maven protoc build plugin. Flow now: protobuf file -> java code -> gRPC client. So, is there any way to skip this step? How to create a generic GRPC client that can call the server directly from the protobuf file without compile into java code? Or, is there a way to Generated Code at runtime? Flow expect: protobuf file ->

Java Grpc: invalidate dns cache

北慕城南 提交于 2021-02-08 03:25:12
问题 I have a grpc client pointing to a url which resolves to 2 IP addresses. The problem is when one server node goes down and then gets back, it's not picked by the grpc client and all the load goes to a single node. I tried recommendation to change networkaddress.cache.ttl propetty but it didn't help. My code (in Scala) java.security.Security.setProperty("networkaddress.cache.ttl", "30") System.setProperty("networkaddress.cache.ttl", "30") val channel = NettyChannelBuilder.forAddress(host, port

bindableService issue with grpc-java

我是研究僧i 提交于 2021-02-05 11:25:26
问题 I am trying to use grpc-java v1.1.2 (build.gradle section below) but when I try to run the fat jar for the sample application, its throwing the exception given below. I do not see any issues when compiling the application. build.gradle parts: apply plugin: 'com.google.protobuf' buildscript { repositories { mavenCentral() mavenLocal() } dependencies { // ASSUMES GRADLE 2.12 OR HIGHER. Use plugin version 0.7.5 with earlier // gradle versions classpath 'com.google.protobuf:protobuf-gradle-plugin

SSL error with GRPC Java

走远了吗. 提交于 2021-01-28 07:58:35
问题 JDK version : 1.8u77 proto3.0.3 version I have tried incorporating SSL into current application. Please find below approaches we have tried. 1) OpenSSL Static approach We have added the io.netty.tcnative-boringssl-static, io.netty.handler and bundles to com.pelco.vms.pelcotools.application.bnd and Tried the below code snippet (added to RPCHandler) : SslContext sslContext = SslContextBuilder.forServer(certificatePemFile, privateKeyPemFile)) .sslProvider(SslProvider.OPENSSL) .build(); server =

How to pass data from grpc rpc call to server interceptor in java

与世无争的帅哥 提交于 2021-01-21 11:14:37
问题 I am trying to set some metadata with a value from the response after the rpc server call has been processed. The plan was to use server interceptor and override close method. Something like this: https://github.com/dconnelly/grpc-error-example/blob/master/src/main/java/example/Errors.java#L38 Since the metadata value depends on the response, I need some way to pass data from rpc server call to server interceptor or access the response from interceptor In Golang, the metadata can be set

Error: Caused by: io.netty.handler.codec.http2.Http2Exception: Window size overflow for stream: 0

徘徊边缘 提交于 2021-01-05 13:08:15
问题 Error while calling a remote machine using grpc witout ssl. On first execution, works fine. On second client execution, the error occurs. On client side I'm open and close a channel on each request like that: channel = ManagedChannelBuilder.forAddress(host, port).usePlaintext().build(); stub = ApiServiceGrpc.newBlockingStub(channel); stub.CreateRequest(request); channel.shutdown().awaitTermination(5, TimeUnit.SECONDS); Server side: "io.grpc:grpc-protobuf:1.23.0" "io.grpc:grpc-stub:1.23.0" "io

Error: Caused by: io.netty.handler.codec.http2.Http2Exception: Window size overflow for stream: 0

别说谁变了你拦得住时间么 提交于 2021-01-05 13:02:12
问题 Error while calling a remote machine using grpc witout ssl. On first execution, works fine. On second client execution, the error occurs. On client side I'm open and close a channel on each request like that: channel = ManagedChannelBuilder.forAddress(host, port).usePlaintext().build(); stub = ApiServiceGrpc.newBlockingStub(channel); stub.CreateRequest(request); channel.shutdown().awaitTermination(5, TimeUnit.SECONDS); Server side: "io.grpc:grpc-protobuf:1.23.0" "io.grpc:grpc-stub:1.23.0" "io

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

故事扮演 提交于 2021-01-01 05:05:43
问题 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