I'm using the Apache PoolingHttpClientConnectionManager
to create a pool of connections to difference services on my network. The documentation says that Connections are pooled on a per route basis. It is not entirely clear to me what is meant by a route.
I found another similar question, but the answer is still a little unclear. If we have two applications on the same server, each with multiple REST api's, is each API considered a distinct route?
For example, if we have the following:
http://server1/app1/books
http://server1/app1/magazines
http://server1/app2/cars
http://server1/app2/cars/color/red
http://server1/app2/cars/color/black/doors/2
Would each of the above be considered a single route?
PoolingHttpClientConnectionManager
implements ConnPoolControl<HttpRoute>
, so we can presume that the routes we are talking about are HttpRoute
's.
In the documentation, it's written that HttpRoute
is
The route for a request.
One of the constructor of HttpRoute
is of the form :
HttpRoute(HttpHost target, InetAddress local, HttpHost[] proxies, boolean secure, RouteInfo.TunnelType tunnelled, RouteInfo.LayerType layered)
Looking at RouteInfo.LayerType
, we see :
The layering type of a route. Plain routes are established by connecting or tunnelling. Layered routes are established by layering a protocol such as TLS/SSL over an existing connection. Protocols can only be layered over a tunnel to the target, or or over a direct connection without proxies.
In conclusion, in this context, the term route should be understood as a network route and not as a mapping from url to controllers as defined by the tag "routes" of your question.
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