I currently configure Jest by giving it a list of server URIs. Like this:
public JestClient jestClient() {
final JestClientFactory factory = new JestClientFactory();
factory.setHttpClientConfig(new HttpClientConfig
.Builder(esServerUris)
.build());
final JestClient jestClient = factory.getObject();
return jestClient;
}
If one of my ElasticSearch servers go offline (e.g. failure or maintenance), then a percentage of my Jest queries fail. Jest doesn't seem to do any kind of intelligent connection management by default.It must do something like round-robin through the servers or pick a server at random.
Is there a better way to handle this?