You can enable withWaitForReady <https://grpc.github.io/grpc-java/javadoc/io/grpc/stub/AbstractStub.html#withWaitForReady--> in your client stub. Then the rpc will wait until server is up.
On Wednesday, September 4, 2019 at 11:23:29 PM UTC-7, Ankit Bansal wrote: > > Hi Guys, > > Can a grpc client wait/block till grpc-server serving the RPC becomes > available? I mean if gRPC client specifies a host:port pair ( gRPC server > ) to connect to and for some reason gRPC server was not available > immediately, can the client wait for it to become available? > > In my setup, I keep getting io.grpc.StatusRuntimeException: UNAVAILABLE > error due to grpc-server side taking time to come up and client tries to > connect before it could come up. > > I am using a NettyChannelBuilder to build the channel and passing this > channel to create a blocking stub which is used to make RPC calls. > gRPC library versions for JARs that i am using is 1.7.0 > > Thanks, > Ankit Kumar > -- You received this message because you are subscribed to the Google Groups "grpc.io" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/01ccc832-f065-4b1d-81ba-bf0676cc7ccf%40googlegroups.com.
