Skip to content

Commit 9822a6f

Browse files
committed
Docs: Explain closing the high level client
It looks like we weren't clear on when and why you should close the high level client and folks were closing it after every request which is not efficient. This explains why you should close the client and when so this shouldn't be as common. Closes #32001
1 parent de2eb85 commit 9822a6f

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

docs/java-rest/high-level/getting-started.asciidoc

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,11 @@ include-tagged::{doc-tests}/MiscellaneousDocumentationIT.java[rest-high-level-cl
130130
--------------------------------------------------
131131

132132
The high-level client will internally create the low-level client used to
133-
perform requests based on the provided builder, and manage its lifecycle.
134-
135-
The high-level client instance needs to be closed when no longer needed so that
136-
all the resources used by it get properly released, as well as the underlying
137-
http client instance and its threads. This can be done through the `close`
138-
method, which will close the internal `RestClient` instance.
133+
perform requests based on the provided builder. That low-level client
134+
maintains a pool of connections and starts some threads so you should
135+
close the high-level client when you are well and truly done with
136+
it and it will in turn close the internal low-level client to free those
137+
resources. This can be done through the `close`:
139138

140139
["source","java",subs="attributes,callouts,macros"]
141140
--------------------------------------------------

0 commit comments

Comments
 (0)