Skip to content

Commit

Permalink
🎨 #1534 更http新默认connectionRequestTimeout ConnectionPoolTimeoutException
Browse files Browse the repository at this point in the history
从连接池获取连接时不应该设置默认超时时间,实测多线程同时进行Http请求时会出错(比如业务需要同时推送大量模板消息时会使用多线程发送,实测30线程同时推送2000条模板消息约有10%因为获取不到连接报org.apache.http.conn.ConnectionPoolTimeoutException异常导致消息发送失败),参考:https://www.jianshu.com/p/48f5f57e9920
  • Loading branch information
niefy committed Apr 27, 2020
1 parent 9472dd3 commit 1b02b0a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
public class DefaultApacheHttpClientBuilder implements ApacheHttpClientBuilder {
protected final Logger log = LoggerFactory.getLogger(DefaultApacheHttpClientBuilder.class);
private final AtomicBoolean prepared = new AtomicBoolean(false);
private int connectionRequestTimeout = 3000;
private int connectionRequestTimeout = -1;
private int connectionTimeout = 5000;
private int soTimeout = 5000;
private int idleConnTimeout = 60000;
Expand Down

0 comments on commit 1b02b0a

Please sign in to comment.