diff --git a/java-client/src/test/java/co/elastic/clients/documentation/getting_started/ConnectingTest.java b/java-client/src/test/java/co/elastic/clients/documentation/getting_started/ConnectingTest.java index 4e2bb87a6..c779ab745 100644 --- a/java-client/src/test/java/co/elastic/clients/documentation/getting_started/ConnectingTest.java +++ b/java-client/src/test/java/co/elastic/clients/documentation/getting_started/ConnectingTest.java @@ -67,6 +67,11 @@ public void createClient() throws Exception { // And create the API client ElasticsearchClient esClient = new ElasticsearchClient(transport); + + // Use the client... + + // Close the transport, freeing the underlying thread + transport.close(); //end::create-client //tag::first-request @@ -115,6 +120,11 @@ restClient, new JacksonJsonpMapper(), null, esOtelInstrumentation // And create the API client ElasticsearchClient esClient = new ElasticsearchClient(transport); + + // Use the client... + + // Close the transport, freeing the underlying thread + transport.close(); //end::create-client-otel } @@ -150,6 +160,11 @@ AuthScope.ANY, new UsernamePasswordCredentials(login, password) // Create the transport and the API client ElasticsearchTransport transport = new RestClientTransport(restClient, new JacksonJsonpMapper()); ElasticsearchClient client = new ElasticsearchClient(transport); + + // Use the client... + + // Close the transport, freeing the underlying thread + transport.close(); //end::create-secure-client-cert } @@ -185,6 +200,11 @@ AuthScope.ANY, new UsernamePasswordCredentials(login, password) // Create the transport and the API client ElasticsearchTransport transport = new RestClientTransport(restClient, new JacksonJsonpMapper()); ElasticsearchClient client = new ElasticsearchClient(transport); + + // Use the client... + + // Close the transport, freeing the underlying thread + transport.close(); //end::create-secure-client-fingerprint }