Skip to content

Commit 3463205

Browse files
Corneil du Plessissnicoll
Corneil du Plessis
authored andcommitted
Apply connection timeout correctly
This commit updates HttpComponents5MessageSender to apply the configured connection timeout. Previously, it was wrongly set as the connection request timeout. Closes gh-1436
1 parent 2744867 commit 3463205

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpComponents5ClientFactory.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ public boolean isSingleton() {
200200
}
201201

202202
@Override
203+
@SuppressWarnings("deprecation")
203204
public CloseableHttpClient getObject() throws Exception {
204205

205206
PoolingHttpClientConnectionManagerBuilder connectionManagerBuilder = PoolingHttpClientConnectionManagerBuilder
@@ -218,7 +219,7 @@ public CloseableHttpClient getObject() throws Exception {
218219
applyMaxConnectionsPerHost(this.connectionManager);
219220

220221
RequestConfig.Builder requestConfigBuilder = RequestConfig.custom() //
221-
.setConnectionRequestTimeout(Timeout.of(this.connectionTimeout)) //
222+
.setConnectTimeout(Timeout.of(this.connectionTimeout)) //
222223
.setResponseTimeout(Timeout.of(this.readTimeout));
223224

224225
HttpClientBuilder httpClientBuilder = HttpClientBuilder.create() //

0 commit comments

Comments
 (0)