@@ -110,6 +110,46 @@ exception will be thrown.
110110
111111See the API documentation for more details.
112112
113+ ### Connection pooling and transport retries ###
114+
115+ ` WebServiceClient ` reuses pooled HTTP connections for performance. Idle
116+ connections can be silently closed by load balancers or other
117+ intermediaries; when the next request reuses such a half-closed connection,
118+ the JDK reports the failure as a ` Connection reset ` , ` Broken pipe ` , or
119+ similar transport error.
120+
121+ To smooth over these intermittent failures, the SDK retries once by
122+ default. Most transport-level ` IOException ` s are retried; the SDK does
123+ ** not** retry:
124+
125+ * ** Timeouts** (` HttpTimeoutException ` , including connect-phase timeouts).
126+ The SDK honors the timeouts you configure rather than extending them.
127+ * ** Cancellation** (` InterruptedIOException ` , or any interrupt observed
128+ before the request runs).
129+ * ** Typically deterministic failures** — ` UnknownHostException ` ,
130+ ` ConnectException ` , ` SSLHandshakeException ` , ` SSLPeerUnverifiedException ` .
131+ Retrying these would just delay surfacing a config bug.
132+
133+ HTTP 4xx and 5xx responses are surfaced through the existing exception
134+ hierarchy and are never retried. Request bodies are replayable, so retried
135+ requests are byte-identical to the original.
136+
137+ You can change the retry budget via the builder:
138+
139+ ``` java
140+ WebServiceClient client = new WebServiceClient .Builder (6 , " ABCD567890" )
141+ .maxRetries(2 ) // up to two retries (three total attempts)
142+ .build();
143+ ```
144+
145+ Set ` .maxRetries(0) ` to disable the retry entirely. Negative values throw
146+ ` IllegalArgumentException ` .
147+
148+ If you frequently see ` Connection reset ` errors, you can also reduce the
149+ JDK's keep-alive timeout via the system property
150+ ` jdk.httpclient.keepalive.timeout ` (in seconds) to evict pooled connections
151+ before any intermediary does so.
152+
113153### Exceptions ###
114154
115155Runtime exceptions:
0 commit comments