Is there a debugging method or way to know whether my gRPC client is connnectable to gRPC remote/local service. I want to know this even before the first call to grpc service call.
Thanks!!
Is there a debugging method or way to know whether my gRPC client is connnectable to gRPC remote/local service. I want to know this even before the first call to grpc service call.
Thanks!!
The network connection won't be established until you made the first RPC call (aka, lazy connect). To overcome transient network failures and ensure your RPC calls are sent out after connecting successfully, you can use waitForReady(). There is also a doc for it here.
There is another option on the ManagedChannel that you can force it to connect: ManagedChannel.getState(true). You can attach a callback via ManagedChannel.notifyWhenStateChanged(...) to monitor if the connection succeeded.