You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Andriy Redko (Jira)" <ji...@apache.org> on 2025/05/08 01:47:00 UTC

[jira] [Comment Edited] (CXF-9132) HttpClientHTTPConduit releases the client while there are connection(s) still using it

    [ https://issues.apache.org/jira/browse/CXF-9132?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17950163#comment-17950163 ] 

Andriy Redko edited comment on CXF-9132 at 5/8/25 1:46 AM:
-----------------------------------------------------------

[~cantos] this is by design: SSL URL change for this specific conduit forces client recreation. Since the only way to acquire client reference is through the acquire, the release must be called as well. There are no inconsistencies here. If you want previous behavior, please pass `{color:#000000}{color:#2a00ff}share.httpclient.http.conduit{color}{color}` with value property  `false` to bus or message.


was (Author: reta):
[~cantos] this is by design: SSL URL change for this specific conduit forces client recreation. Since the only way to acquire client reference is through the acquire, the release must be called as well. There are no inconsistencies here.

> HttpClientHTTPConduit releases the client while there are connection(s) still using it
> --------------------------------------------------------------------------------------
>
>                 Key: CXF-9132
>                 URL: https://issues.apache.org/jira/browse/CXF-9132
>             Project: CXF
>          Issue Type: Bug
>          Components: Transports
>    Affects Versions: 4.1.0, 4.0.5, 4.0.6, 4.0.7, 4.1.1
>         Environment: JDK 21
> CXF 4.0.5/4.0.6/4.0.7/4.1.0/4.1.1
>            Reporter: Cantos Song
>            Priority: Major
>         Attachments: 438528865-8f282ba8-c4de-4451-b2ca-a8f76c79b643.png, TestCxf.java, image-2025-04-29-17-49-06-378.png, image-2025-04-29-17-49-16-376.png, image-2025-05-07-11-25-24-799.png, image-2025-05-08-09-27-38-409.png, image-2025-05-08-09-27-59-002.png, image-2025-05-08-09-28-05-723.png
>
>
> [https://github.com/apache/cxf/pull/1777/files]
> When I used version 4.0.4 without any issues, all subsequent versions had problems.
> If the address is modified, it will be released multiple times.
>  
> throw java.io.IOException: shutdownNow
> throw java.io.IOException: closed
>  
> !image-2025-04-29-17-49-16-376.png!
> !image-2025-04-29-17-49-06-378.png!
> import jakarta.jws.WebMethod;
> import jakarta.jws.WebParam;
> import jakarta.jws.WebResult;
> import org.apache.commons.lang3.RandomUtils;
> import org.apache.cxf.binding.soap.SoapMessage;
> import org.apache.cxf.interceptor.Fault;
> import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
> import org.apache.cxf.phase.AbstractPhaseInterceptor;
> import org.apache.cxf.phase.Phase;
> import java.util.ArrayList;
> import java.util.List;
> public class TestCxf {
> public static void main(String[] args) throws InterruptedException {
> HTNGOutboundWebService byAddress = getByAddress();
> int i = 0;
> while (i <= 300) {
> Thread.ofVirtual().start(new Runnable() {
> @Override
> public void run() {
> try
> { byAddress.ratePlanSubmitRequest(""); }
> catch (Exception e) {
> if (!e.getCause().toString().contains("HTTP response"))
> { e.printStackTrace(); }
> }
> }
> } );
> i++;
> }
> Thread.sleep(100000);
> }
> public static class HTNGHeaderOutInterceptor1 extends AbstractPhaseInterceptor<SoapMessage> {
> static List<String> address = new ArrayList();
> public HTNGHeaderOutInterceptor1()
> { super(Phase.PREPARE_SEND); address.add("https://www.baidu.com"); address.add("https://www.tencent.com"); }
> @Override
> public void handleMessage(SoapMessage message) throws Fault
> { int i1 = RandomUtils.secure().randomInt(0, 2); message.put(org.apache.cxf.message.Message.ENDPOINT_ADDRESS, address.get(i1)); }
> }
> public static HTNGOutboundWebService getByAddress()
> { JaxWsProxyFactoryBean jaxWsProxyFactoryBean = new JaxWsProxyFactoryBean(); jaxWsProxyFactoryBean.setServiceClass(HTNGOutboundWebService.class); jaxWsProxyFactoryBean.getOutInterceptors().add(new HTNGHeaderOutInterceptor1()); HTNGOutboundWebService soap = (HTNGOutboundWebService) jaxWsProxyFactoryBean.create(); return soap; }
> public interface HTNGOutboundWebService
> { @WebMethod(operationName = "RatePlan_SubmitRequest", action = "http://htng.org/PWSWG/2010/12/RatePlan_SubmitRequest") @WebResult(name = "OTA_HotelRatePlanNotifRS", targetNamespace = "http://www.opentravel.org/OTA/2003/05", partName = "OTA_HotelRatePlanNotifRS") public void ratePlanSubmitRequest( @WebParam(partName = "OTA_HotelRatePlanNotifRQ", name = "OTA_HotelRatePlanNotifRQ", targetNamespace = "http://www.opentravel.org/OTA/2003/05") String aa ); }
> }
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)