Hi Zsolt,
The RESTEasy Client uses the Apache HTTP Client in the underlying, so
the behavior may also be affected by the Apache HTTP Client version it
uses. Have you tried to use the RESTEasy 6.x client? In addition,
creating a simplified sample project to see the project on Github
would be helpful to investigate the problem :-)
On Mon, Aug 7, 2023 at 8:01 PM Zsolt Melich <stocek86@gmail.com> wrote:
>
> Hi all!
>
> I'm facing with the error message in the subject since I had to switch from RestEasy v3.0.18 (I know, quite old) to v4.7.9.
> We have a great, complex IVR application (written in Java 8), what is using RestEasy for the WS client we have for the API calls throughout a calls. The application is deployed to a Tomcat 9 application server.
>
> The current version of the client creates a RestEasy client instance for each API invocation, then close the response and the client (with the close() method). This is quite expensive, so I planned to change this when I switch to v4.7.9.
> In the new version I create the client at the beginning, closing the response (to let the resource back to the pool) after each invocation, and shut down the client with close() at the very end (only once).
> We create the PoolingHttpClientConnectionManager instance, the engine instance (ApacheHttpClient43Engine) and the httpClient instance manually, then we pass the engine to the ClientBuilder to create the client instance.
>
> The problem is that I can make only one IVR test call without any issue. At the very end of the first call, the connection is being closed. In the second call I got the exception from the subject for the very first API call.
> I checked the logs, traced my test calls and everything is looking fine (the app does not close the connection before the invocation). After a Tomcat restart I'm able to do a successful test call again, but only for one time! After a successful call, I'm getting the same exception in the next call...
>
> Does the close() method of the client instance destroy the whole connection pool for later calls as well when I close the connection at the end of the first call? Is this normal?
> We didn't have this issue with v.3.0.18.
>
> P.S. : I know I haven't provided any exact code yet, but I try to clarify and understand the mechanics first.
>
> Thanks for the helping replies in advance!
> _______________________________________________
> resteasy mailing list -- resteasy@lists.jboss.org
> To unsubscribe send an email to resteasy-leave@lists.jboss.org
> Privacy Statement: https://www.redhat.com/en/about/privacy-policy
> List Archives: https://lists.jboss.org/archives/list/resteasy@lists.jboss.org/message/WAOAZJ7DAV2HSF6MQ4QEI3NTTXANXWWZ/
--
Cheers,
Wei Nan | JBoss