Skip to content

Commit

Permalink
Merge pull request #61 from fcfang123/issue-60
Browse files Browse the repository at this point in the history
feat:http读请求连接延长至60s #60
  • Loading branch information
mingshewhe authored Jul 21, 2023
2 parents c1cd464 + fd605fe commit b937423
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ ext {
set("junitVersion", "5.4.2")

if (System.getProperty("snapshot") == "true") {
set('iamVersion', "1.0.29-SNAPSHOT")
set('iamVersion', "1.0.30-SNAPSHOT")
} else {
set('iamVersion', "1.0.0")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,10 @@
@Slf4j
public class ApigwHttpClientServiceImpl implements HttpClientService {

private final CloseableHttpClient httpClient;
private final IamConfiguration iamConfiguration;
private CloseableHttpClient httpClient = DefaultApacheHttpClientBuilder.get().build();
private IamConfiguration iamConfiguration;

public ApigwHttpClientServiceImpl(IamConfiguration iamConfiguration) {
this.httpClient = DefaultApacheHttpClientBuilder.get().build();
this.iamConfiguration = iamConfiguration;
}

public ApigwHttpClientServiceImpl(CloseableHttpClient httpClient, IamConfiguration iamConfiguration) {
this.httpClient = httpClient;
this.iamConfiguration = iamConfiguration;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class DefaultApacheHttpClientBuilder implements ApacheHttpClientBuilder {
private final AtomicBoolean prepared = new AtomicBoolean(false);
private int connectionRequestTimeout = 3000;
private int connectionTimeout = 5000;
private int soTimeout = 5000;
private int soTimeout = 60000;
private int idleConnTimeout = 60000;
private int checkWaitTime = 60000;
private int maxConnPerHost = 10;
Expand Down Expand Up @@ -140,9 +140,9 @@ public void setConnectionTimeout(int connectionTimeout) {
}

/**
* 默认NIO的socket超时设置,默认5000ms.
* 默认NIO的socket超时设置,默认60S.
*
* @param soTimeout 默认NIO的socket超时设置,默认5000ms.
* @param soTimeout 默认NIO的socket超时设置,默认60S.
* @see java.net.SocketOptions#SO_TIMEOUT
*/
public void setSoTimeout(int soTimeout) {
Expand Down

0 comments on commit b937423

Please sign in to comment.