I have been using the ES5 RestClient which I am building as follows:
The failureListener that I have created simply logs a message that there has been a failure as follows:
Host [http://localhost:9200] failure
When the above failure occurs (for a bulk indexing test I have been running) it will later be followed by a timeout:
java.io.IOException: listener timeout after waiting for  ms
After a failure will the RestClient be in a usable state? Should I rebuild a new RestClient after a failure or perhaps do something in the onFailure method to recover?
If I want to add retry logic what is the best way to do this? Should I add retry logic around RestClient or can the RestClient provide it? Sounds a bit hacky, but if I provided a list of two identical hosts (&port) would the RestClient retry on the 'other' host if the first one failed?