On 4 Aug 2011, at 14:55, KARR, DAVID (ATTSI) wrote:

>> Worth noting, in your above snippet the max connections per route will
>> only be *2*.
> 
> Sorry to the OP to hijack this question, but I'd like to understand a little 
> more about this.  Is a "route" defined as the path to a particular host?  If 
> all of my connections go to the same host, and I'll have numerous threads 
> trying to make that connection, do I need to change some default to allow 
> more than 2 connections per "route"?
> 

Yes, I believe so, you can either set 

ThreadSafeClientConnManager.setDefaultMaxPerRoute(myMaxPerRoute);

Which maybe what you need if you can be *sure* you only ever talk to one host. 
Or:

ThreadSafeClientConnManager.setMaxForRoute(new HttpRoute(new HttpHost(MyHost, 
MyPort), thisRoutesMax);

Which maybe suitable if you have a few hosts you hit with different 
capabilities (say a heterogeneous cluster.)

Cheers

Russell

Reply via email to