mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-08-24 16:18:51 +08:00
Merge pull request #40 from kakotor/develop
增加设置setConnectionManagerShared参数
This commit is contained in:
commit
b26a01767d
@ -1,8 +1,6 @@
|
|||||||
package me.chanjar.weixin.common.util.http;
|
package me.chanjar.weixin.common.util.http;
|
||||||
|
|
||||||
import java.io.IOException;
|
import me.chanjar.weixin.common.util.StringUtils;
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
|
|
||||||
import org.apache.http.annotation.NotThreadSafe;
|
import org.apache.http.annotation.NotThreadSafe;
|
||||||
import org.apache.http.auth.AuthScope;
|
import org.apache.http.auth.AuthScope;
|
||||||
import org.apache.http.auth.UsernamePasswordCredentials;
|
import org.apache.http.auth.UsernamePasswordCredentials;
|
||||||
@ -23,7 +21,8 @@ import org.apache.http.impl.client.HttpClients;
|
|||||||
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
|
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
|
||||||
import org.apache.http.protocol.HttpContext;
|
import org.apache.http.protocol.HttpContext;
|
||||||
|
|
||||||
import me.chanjar.weixin.common.util.StringUtils;
|
import java.io.IOException;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* httpclient 连接管理器
|
* httpclient 连接管理器
|
||||||
@ -125,6 +124,7 @@ public class DefaultApacheHttpClientBuilder implements ApacheHttpClientBuilder {
|
|||||||
|
|
||||||
this.httpClientBuilder = HttpClients.custom()
|
this.httpClientBuilder = HttpClients.custom()
|
||||||
.setConnectionManager(connectionManager)
|
.setConnectionManager(connectionManager)
|
||||||
|
.setConnectionManagerShared(true)
|
||||||
.setDefaultRequestConfig(
|
.setDefaultRequestConfig(
|
||||||
RequestConfig.custom()
|
RequestConfig.custom()
|
||||||
.setSocketTimeout(this.soTimeout)
|
.setSocketTimeout(this.soTimeout)
|
||||||
|
Loading…
Reference in New Issue
Block a user