I’d like a simple way of verifying that ES is available to a Java
client. I have a factory that looks something like this to get a
client instance:
https://gist.github.com/1364734
What’s the best way to gracefully handle the scenario of ES not being
available or is what I have sufficient?
Shay previously confirmed that this approach is a good one. The approach is backed up by the documentation as well.
As for gracefully handling. You should just error the request or process that is attempting to execute the search. It’s possible the
TransportClientbecomes connected and future requests may succeed.Copying your function here for the sake of completeness.
From https://gist.github.com/1364734