現在、サーバー URI のリストを指定して Jest を構成しています。このような:
public JestClient jestClient() {
final JestClientFactory factory = new JestClientFactory();
factory.setHttpClientConfig(new HttpClientConfig
.Builder(esServerUris)
.build());
final JestClient jestClient = factory.getObject();
return jestClient;
}
ElasticSearch サーバーの 1 つがオフラインになると (障害やメンテナンスなど)、Jest クエリの一部が失敗します。Jest は、デフォルトでは、インテリジェントな接続管理を一切行っていないようです。サーバーを介してラウンドロビンのようなことを行うか、ランダムにサーバーを選択する必要があります。
これを処理するより良い方法はありますか?