Skip to content

Commit e028557

Browse files
committed
adds maxRetry
1 parent 4f6470c commit e028557

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

elasticsearch-driver/src/main/java/org/jnosql/diana/elasticsearch/document/ElasticsearchDocumentConfiguration.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
* It tries to read the configuration properties from diana-elasticsearch.properties file. To get some information:
3939
* <p>elasticsearch-host-n: the host to client connection, if necessary to define a different port than default just
4040
* use colon, ':' eg: elasticsearch-host-1=172.17.0.2:1234</p>
41+
* <p>elasticsearch-maxRetryTimeoutMillis</p>
4142
*/
4243
public class ElasticsearchDocumentConfiguration implements UnaryDocumentConfiguration<ElasticsearchDocumentCollectionManagerFactory> {
4344

@@ -49,6 +50,7 @@ public class ElasticsearchDocumentConfiguration implements UnaryDocumentConfigur
4950

5051
private List<Header> headers = new ArrayList<>();
5152

53+
private int maxRetryTimoutMillis = 0;
5254

5355
public ElasticsearchDocumentConfiguration() {
5456

@@ -107,6 +109,9 @@ public ElasticsearchDocumentCollectionManagerFactory get(Settings settings) thro
107109

108110
RestClientBuilder builder = RestClient.builder(httpHosts.toArray(new HttpHost[httpHosts.size()]));
109111
builder.setDefaultHeaders(headers.stream().toArray(Header[]::new));
112+
113+
builder.setMaxRetryTimeoutMillis(maxRetryTimoutMillis);
114+
builder.set
110115
RestHighLevelClient client = new RestHighLevelClient(builder);
111116
return new ElasticsearchDocumentCollectionManagerFactory(client);
112117
}

0 commit comments

Comments
 (0)