File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed
core/sdk-core/src/main/java/software/amazon/awssdk/core Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change 25
25
26
26
/**
27
27
* Input stream that provides access to the unmarshalled POJO response returned by the service in addition to the streamed
28
- * contents. This input stream should be closed to release the underlying connection back to the connection pool.
29
- *
28
+ * contents. This input stream should be closed after all data has been read from the stream.
29
+ * <p>
30
+ * Note about the Apache http client: This input stream can be used to leverage a feature of the Apache http client where
31
+ * connections are released back to the connection pool to be reused. As such, calling {@link ResponseInputStream#close() close}
32
+ * on this input stream will result in reading the remaining data from the stream and leaving the connection open, even if the
33
+ * stream was only partially read from. For large http payload, this means reading <em>all</em> of the http body before releasing
34
+ * the connection which may add latency.
35
+ * <p>
36
+ * If it is not desired to read remaining data from the stream, you can explicitly abort the connection via {@link #abort()}
37
+ * instead. This will close the underlying connection and require establishing a new HTTP connection on subsequent requests which
38
+ * may outweigh the cost of reading the additional data.
30
39
* <p>
31
- * If it is not desired to read remaining data from the stream, you can explicitly abort the connection via {@link #abort()}.
32
- * Note that this will close the underlying connection and require establishing an HTTP connection which may outweigh the
33
- * cost of reading the additional data.
34
- * </p>
40
+ * The Url Connection and Crt http clients are not subject to this behaviour so the {@link ResponseInputStream#close() close} and
41
+ * {@link ResponseInputStream#abort() abort} methods will behave similarly with them.
35
42
*/
36
43
@ SdkPublicApi
37
44
public final class ResponseInputStream <ResponseT > extends SdkFilterInputStream implements Abortable {
You can’t perform that action at this time.
0 commit comments