Hi,
I have been using the ES5 RestClient which I am building as follows:
RestClient.builder(hosts)
.setFailureListener(failureListener)
.build();
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 [10000] ms
at org.elasticsearch.client.RestClient$SyncResponseListener.get(RestClient.java:616)
at org.elasticsearch.client.RestClient.performRequest(RestClient.java:212)
at org.elasticsearch.client.RestClient.performRequest(RestClient.java:184)
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?
Cheers,
Stuart