1

I'm implementing a rest client based on MicroProfile Rest Client spec and deployed on Open Liberty 22.0.0.9.

After a few performance tests with JMeter it seems that the connection pool for the rest client is only 10.

How can I change this because it is really not enough for our usage ?

It seems that the underlying client implementation is still cxf (org.apache.cxf.microprofile.client.CxfTypeSafeClientBuilder). On this page https://openliberty.io/docs/latest/reference/jaxrs-dif.html it is stated that "The underlying JAX-RS implementation for Open Liberty also changed from Apache CXF to RESTEasy." Does the implementation for jaxrs 2.0 and 2.1 have also switched to Resteasy or is it true only for restfulWS-3.0 ?

Anyway, to change the configuration of cxf I've tried to add a jvm.options property "-Dhttp.maxConnections=100" but it has not effect.

I've also set a RestClientBuilderListener but I don't find any working property to set on the RestClientBuilder...

Any idea how I can achieve this ?

Clément Honoré
  • 137
  • 1
  • 12

1 Answers1

0

For mpRestClient-2.0:

If used synchronously, then the underlying CXF uses the JDK's HttpURLConnection. By default, HTTP Keep-Alive is enabled and used, unless the server responds with a "Connection: close" response header. If it does not, then the maximum number of cached keep-alive connections per destination host is controlled with -Dhttp.maxConnections=X (default 5). If the server responds with a "Keep-Alive: timeout=X" response header, then the KeepAliveCache will purge and close the connection after approximately X seconds of idleness. If the server does not respond with such a header, the default is 5 seconds and cannot be tuned.

If used asynchronously, then the underlying CXF uses Apache HttpClient, and the HttpClient may be tuned with client.setProperty calls such as

  • org.apache.cxf.transport.http.async.MAX_CONNECTIONS
  • org.apache.cxf.transport.http.async.MAX_PER_HOST_CONNECTIONS
  • org.apache.cxf.transport.http.async.CONNECTION_TTL
  • org.apache.cxf.transport.http.async.CONNECTION_MAX_IDLE
kgibm
  • 852
  • 10
  • 22