James,
Thank you for your reply. I checked the jmeter.properties file, and I was not setting httpclient4.idletimeout. I set that to 10000ms, and then edited my JMeter script to use a HTTPSampler.connect_timeout and HTTPSampler.response_timeout to both 10000. I then set the HTTPSampler.implementation to HttpClient4 which I think the RestEasy client uses. I did get better results this time on my test runs.
It is not backported, but I could backport to RestEasy 3.15.1.Final because it is just a few lines of code.
As an alternative method of testing I created a test client where I am spinning up 100's of java.lang.Runnable threads, but the test client is not able to ramp up connections gradually like JMeter. I set each thread with a readTimeout/connectTimeout of 10000 each that closes the response and client when it is done with it. This is what it looks like:
import jakarta.ws.rs.client.*;
import jakarta.ws.rs.core.Response;
import org.jboss.resteasy.client.jaxrs.ResteasyWebTarget;
import java.util.concurrent.TimeUnit;
public class WebServiceClientRunnableTaskUnsecure implements Runnable {
private final String URL;
private long readTimeout = 0;
private long connectTimeout = 0;
public WebServiceClientRunnableTaskUnsecure(String targetUrl, long readTimeout, long connectTimeout) {
this.URL = targetUrl;
this.readTimeout = readTimeout;
this.connectTimeout = connectTimeout;
}
@Override
public void run() {
Response response = null;
Client client = null;
try {
ClientBuilder clientBuilder = ClientBuilder.newBuilder()
.readTimeout(readTimeout, TimeUnit.MILLISECONDS)
.connectTimeout(connectTimeout, TimeUnit.MILLISECONDS);
client = clientBuilder.build();
ResteasyWebTarget target = (ResteasyWebTarget) client.target(URL);
Invocation.Builder request = target.request();
response = request.get();
int status = response.getStatus();
} catch (Exception e) {
Thread.currentThread().interrupt();
} finally {
if (response != null) {
response.close();
}
if (client != null) {
client.close();
}
}
}
}