I am trying to connect to go server with java GRPC client (netty and okhttp). But both of them are throwing UNAVAILABLE: io exception intermittently.
The occurrence is random and we don't know what's causing this behaviour. We found out that the request didn't reach the go server.
The blocking stub used to connect is something similar to:
public SomeServiceGrpc.SomeServiceBlockingStub getBlockingStub() {
ManagedChannel channel = OkHttpChannelBuilder
.forAddress(configuration.getHost(), configuration.getPort())
.useTransportSecurity()
.keepAliveTime(1, TimeUnit.MINUTES)
.keepAliveTimeout(5, TimeUnit.SECONDS)
.intercept(deadlineInterceptor)
.build();
return SomeServiceGrpc.newBlockingStub(channel);
}
These are the libraries used for okhttp and protobuf:
compile 'io.grpc:grpc-okhttp:1.21.0'
compile 'io.grpc:grpc-protobuf:1.20.0'
compile 'io.grpc:grpc-stub:1.20.0'
These are the libraries used for netty and protobuf:
compile group: 'io.grpc', name: 'grpc-netty', version: '1.22.1'
compile group: 'io.netty', name: 'netty-handler', version: '4.1.35.Final'
compile group: 'io.netty', name: 'netty-tcnative-boringssl-static', version: '2.0.25.Final'
compile 'io.grpc:grpc-protobuf:1.20.0'
compile 'io.grpc:grpc-stub:1.20.0'
Any help or lead appreciated.