ThreadSafeClientConnManager is deprecated and a new method is introduced PoolingClientConnectionManager.
The documentation of PoolingClientConnectionManager says
Manages a pool of client connections and is able to service connection requests from multiple execution threads. Connections are pooled on a per route basis.
My Question
What is the meaning of per route basis here?
Put it in simple term, per route means per host you are connecting to. PoolingHttpClientConnectionManager maintains a maximum limit of connections on a per route basis and in total. Per default this implementation will create no more than 2 concurrent connections per given route and no more 20 connections in total.
Connections are pooled on a per route basis. A request for a route for which the manager already has a persistent connection available in the pool will be serviced by leasing a connection from the pool rather than creating a brand new connection.
The maximum number of connections allowed for a route that has not been specified otherwise by a call to setMaxPerRoute. Use setMaxPerRoute when you know the route ahead of time and setDefaultMaxPerRoute when you do not. setConnectTimeout.
Put it in simple term, per route means per host you are connecting to.
PoolingHttpClientConnectionManager
maintains a maximum limit of connections on a per route basis and in total. Per default this implementation will create no more than 2 concurrent connections per given route and no more 20 connections in total.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With