1: (ainda não sabe)
2: Você pode configurar o Jest para repetir as operações do Elasticsearch que falham com erros de rede como:
new JestClientFactory() {
@Override
protected HttpClientBuilder configureHttpClient(HttpClientBuilder builder) {
builder = super.configureHttpClient(builder);
// See DefaultHttpRequestRetryHandler.requestSentRetryEnabled
//
// true if it's OK to retry non-idempotent requests that have been sent
// and then fail with network issues (not HTTP failures).
//
// "true" here will retry POST requests which have been sent but where
// the response was not received. This arguably is a bit risky.
//
// Retries are logged at INFO level to org.apache.http.impl.execchain.RetryExec
boolean requestSentRetryEnabled = true;
builder.setRetryHandler(new DefaultHttpRequestRetryHandler(
3,
requestSentRetryEnabled));
return builder;
}
}