Last active
August 3, 2022 02:45
-
-
Save parthmistry/5456737b5fff4afa7dde3a831740ce4f to your computer and use it in GitHub Desktop.
Customize connection pool settings for Elasticsearch Java API Client
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var restClient = RestClient.builder(new HttpHost("SERVER_HOST", SERVER_PORT)) | |
.setHttpClientConfigCallback(clientConfigCallback -> { | |
return clientConfigCallback.setMaxConnPerRoute(50).setMaxConnTotal(50); | |
}).build(); | |
var restClientTransport = new RestClientTransport(restClient, new JacksonJsonpMapper()); | |
var elasticsearchClient = new ElasticsearchAsyncClient(restClientTransport); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment