-
Notifications
You must be signed in to change notification settings - Fork 952
Open
Description
common中的http连接池初始化逻辑有问题,日志中持续输出(Initialize the PoolingHttpClientConnectionManager -- maxTotal:100, defaultMaxPerRoute:50)
以下条件在代码中不成立,导致反复初始化:
`public CloseableHttpClient getHttpClient() {
if (null != httpClient) {
return httpClient;
}
if (null == configStorage) {
return httpClient = HttpClients.createDefault();
}
CloseableHttpClient httpClient = HttpClients
.custom()
//网络提供者
.setDefaultCredentialsProvider(createCredentialsProvider(configStorage))
.setConnectionManager(connectionManager(configStorage))
//设置httpclient的SSLSocketFactory
.setSSLSocketFactory(createSSL(configStorage))
.setDefaultRequestConfig(createRequestConfig(configStorage))
.build();
if (null == connectionManager) {
return this.httpClient = httpClient;
}
return httpClient;
}`
对connectionManager判断为null才更新client并返回的逻辑请确认是否存在问题
Metadata
Metadata
Assignees
Labels
No labels