[ https://issues.apache.org/jira/browse/CXF-9109?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17930637#comment-17930637 ]
Radek Kraus commented on CXF-9109: ---------------------------------- IMHO this problem was caused by CXF-8678, where per-HTTPClientPolicy caching was introduced ([https://github.com/apache/cxf/pull/923]). AFAIU "per-HTTPClientPolicy caching" means that each instance of {{AsyncHTTPConduit}} has own instance of {{AsyncClient}} (own instance of {{PoolingAsyncClientConnectionManager}} included), regardless on {{{}TlsStrategy{}}}. I am sorry, but I don't understand why {{HTTPClientPolicy}} is used as map key (even without redefined {{{}equals(){}}}/{{{}hashCode(){}}} methods). In addition, there is a comment ({{{}AsyncHTTPConduitFactory{}}}), {_}... the context propagation is necessary to remove per-HTTPClientPolicy caching{_}, but HTTPCLIENT-2209 has already introduced {{HttpContext}} propagation. Does it mean, that now, per-HTTPClientPolicy caching can be somehow removed (because HTTPCLIENT-2209 is done)? Is there some plan to remove per-HTTPClientPolicy? Or I am completelly wrong? When I tried to use {{cxf-rt-transports-http-hc}} (instead of {{{}cxf-rt-transports-http-hc5{}}}), it seems, that attached test/example works like is expected. Thank you for any answer. > MAX_PER_HOST_CONNECTIONS does not work > -------------------------------------- > > Key: CXF-9109 > URL: https://issues.apache.org/jira/browse/CXF-9109 > Project: CXF > Issue Type: Bug > Components: JAX-RS > Affects Versions: 4.1.0 > Reporter: shpelda > Priority: Major > Attachments: ConnectionPoolingTest.java > > > After migration from 3.4.4 to 4.1.0, one of my tests started crashing. > In v3, AsyncHTTPConduitFactory used shared ConnectionManager, so that > bus-level properties > _org.apache.cxf.transport.http.async.MAX_CONNECTIONS_ and > _org.apache.cxf.transport.http.async.MAX_PER_HOST_CONNECTIONS_ > worked across clients. > This properties were the reason why I used the AsyncHTTPConduitFactory, as i > had to limit count of created connections. > > v3 implementation of AsyncHTTPConduitFactory used shared instance of client > and connectionManager, which finally caused above properties to work properly. > hc5.AsyncHTTPConduitFactory(correctly) maintains cache of > httpclientPolicy->httpClient. > However _PoolingAsyncClientConnectionManager_ must not created with each > client, but must be shared. Should be owned by the {_}Bus{_}. > Otherwise connection pool cannot work correctly. -- This message was sent by Atlassian Jira (v8.20.10#820010)