[英]httpClient connection pool manager validateAfterInactivity
I am looking at the documentation of PoolingHttpClientConnectionManager https://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/org/apache/http/impl/conn/PoolingHttpClientConnectionManager.html 我正在查看PoolingHttpClientConnectionManager的文档https://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/org/apache/http/impl/conn/PoolingHttpClientConnectionManager.html
There is an API setValidateAfterInactivity. 有一个API setValidateAfterInactivity。 validateAfterInactivity is not very clear to me.
validateAfterInactivity对我来说不是很清楚。 It says - "Defines period of inactivity in milliseconds after which persistent connections must be re-validated prior to being leased to the consumer"
它说 - “定义不活动的时间段,以毫秒为单位,之后必须重新验证持久连接,然后再租给消费者”
How exactly does it re-validate the connection? 它是如何重新验证连接的呢? Wanted to understand the process.
想要了解这个过程。 Does it send any http request to server or something to re-validate, or its something else?
它是否向服务器发送任何http请求或重新验证的内容,或其他内容?
What is the criteria/mechanism it uses to revalidate the connection? 它用于重新验证连接的标准/机制是什么? How does it all work?
它是怎么运行的?
It use JDBC connection to do validate. 它使用JDBC连接来进行验证。
final ManagedHttpClientConnection conn = poolEntry.getConnection();
if (conn != null) {
conn.activate();
} else {
poolEntry.assignConnection(connFactory.createConnection(null));
}
if (log.isDebugEnabled()) {
log.debug("Connection leased: " + ConnPoolSupport.formatStats(
poolEntry.getConnection(), route, state, pool));
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.