Skip to content

Commit 02bd3e6

Browse files
authored
ClientConfigurer is only available in MaybeSecureClientConfigurationBuilder.
The documentation code does not compile and I'm not sure if it's a bug in the code or a miss in the documentation. When you want to configure a client, the doc says to use: ```java ClientConfiguration.builder().withClientConfigurer( // ... ``` But `withClientConfigurer(ClientConfiguration.ClientConfigurationCallback<?> clientConfigurer)` is only available in `TerminalClientConfigurationBuilder` interface. And `ClientConfiguration.builder()` returns a `ClientConfigurationBuilderWithRequiredEndpoint` interface.
1 parent 21a1fbc commit 02bd3e6

File tree

1 file changed

+2
-0
lines changed
  • src/main/antora/modules/ROOT/pages/elasticsearch

1 file changed

+2
-0
lines changed

src/main/antora/modules/ROOT/pages/elasticsearch/clients.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ This callback provides a `org.elasticsearch.client.RestClientBuilder` that can b
192192
[source,java]
193193
----
194194
ClientConfiguration.builder()
195+
.connectedTo("localhost:9200", "localhost:9291")
195196
.withClientConfigurer(ElasticsearchClients.ElasticsearchRestClientConfigurationCallback.from(restClientBuilder -> {
196197
// configure the Elasticsearch RestClient
197198
return restClientBuilder;
@@ -210,6 +211,7 @@ used by the `RestClient`.
210211
[source,java]
211212
----
212213
ClientConfiguration.builder()
214+
.connectedTo("localhost:9200", "localhost:9291")
213215
.withClientConfigurer(ElasticsearchClients.ElasticsearchHttpClientConfigurationCallback.from(httpAsyncClientBuilder -> {
214216
// configure the HttpAsyncClient
215217
return httpAsyncClientBuilder;

0 commit comments

Comments
 (0)