hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mingfai Ma (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HTTPCLIENT-968) Provide a way to configure ConnPerRoute for ThreadSafeClientConnManager
Date Fri, 16 Jul 2010 23:55:49 GMT

    [ https://issues.apache.org/jira/browse/HTTPCLIENT-968?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12889422#action_12889422
] 

Mingfai Ma commented on HTTPCLIENT-968:
---------------------------------------

just realize i can use the deprecated way to configure conn per route. so this issue could
be discarded.

I suppose ThreadSafeClientConnManager should support configuration of ConnPerRoute via a non-deprecated
way. Please feel free to keep this issue for tracking that requirement or just close it. If
the HttpParams will be reverted to non-deprecated, we could read the ConnPerRouteBean from
the param instead of creating a new one every time.

+        Object connPerRouteBean = params.getParameter(ConnManagerPNames.CONNECTIONS_PER_ROUTE);
+        this.connPerRoute = connPerRouteBean!=null? (ConnPerRouteBean)connPerRouteBean: new
ConnPerRouteBean();




> Provide a way to configure ConnPerRoute for ThreadSafeClientConnManager
> -----------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-968
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-968
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: HttpClient
>    Affects Versions: 4.1 Alpha2
>            Reporter: Mingfai Ma
>
> In ThreadSafeClientConnManager, both constructors (the 2nd one is depreciated) create
a new ConnPerRouteBean that is used by createConnectionPool() immediately.  There is no way
to increase the ConnPerRoute in tsccm. Even if I tried to extend TSCCM and overrride createConnectionPool(),
I can't make the ConnPerRouteBean configurable (because the createConnPool method is called
in the super's constructor). The easiest solution is for me to copy the code of TSCCM and
make my own connection manager. 
> I think the TSCCM should provide a way to configure ConnPerRouteBean.
> I'm trying to see how can it be changed:
> * add a constructor argument for connPerRouteBean - this is the the simplest solution
but obviously a bad idea.
> * I guess because of HTTPCLIENT-673, the old ConnManagerPNames.MAX_CONNECTIONS_PER_ROUTE
 static param that doesn't depend on HttpRoute is depreciated. It makes very much sense. 
However, could the static parameter be replaced with a new parameter that take a ConnPerRouteBean
and keep the 2nd constructor in TSCCM and make the constructor use the new param?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Mime
View raw message