Hello,
Just an FYI. The 4.7 version is no longer maintained. If you're still using Jakarta EE 8, you'd want to use the 5.0 versions.

On Mon, Aug 7, 2023 at 5:01 AM 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.

It shouldn't close the pool, no. If you close the client and attempt to reuse the same connection pool, that would likely not work. I believe internally when you close the client, the connection pool is also closed.
 

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/


--
James R. Perkins
JBoss by Red Hat