elasticsearch-java
elasticsearch-java copied to clipboard
Transport level retry
Adds new retry functionality to the client, configurable in the Transport options like so:
RestClient restClient = RestClient
.builder(new HttpHost(address.getHostString(), address.getPort(), "http"))
.build();
// setting transport option
RestClientOptions options = new RestClientOptions(RequestOptions.DEFAULT, false,
BackoffPolicy.constantBackoff(50L, 8));
ElasticsearchTransport transport = new RestClientTransport(
restClient, new JacksonJsonpMapper(), options);
ElasticsearchAsyncClient esClient = new ElasticsearchAsyncClient(transport);
Some doubts remaining in the form of TODOs in the code. (they break checkstyle ignore it for now)
Unit tests available in TransportTest.class