Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the meaning of "per route basis" in PoolingClientConnectionManager?

Tags:

java

http

apache

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?

like image 949
Gaurav Agarwal Avatar asked Aug 19 '12 17:08

Gaurav Agarwal


People also ask

What does per route mean?

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.

What is connection per route?

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.

What is setDefaultMaxPerRoute?

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.


1 Answers

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.

like image 63
sendon1982 Avatar answered Sep 18 '22 18:09

sendon1982