1

I am looking at the documentation of PoolingHttpClientConnectionManager https://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/org/apache/http/impl/conn/PoolingHttpClientConnectionManager.html

There is an API setValidateAfterInactivity. validateAfterInactivity is not very clear to me. 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?

What is the criteria/mechanism it uses to revalidate the connection? How does it all work?

user1892775
  • 2,001
  • 6
  • 37
  • 58

1 Answers1

-1

It use JDBC connection to do validate.

                    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));
                    }

source code here

Qingfei Yuan
  • 1,196
  • 1
  • 8
  • 12