I have a jetty Http client configured as follows:
HttpClient client = new HttpClient();
client.setTimeout(connectionTimeout);
client.setIdleTimeout(readTimeout);
client.setMaxConnectionsPerAddress(100);
client.setThreadPool(new QueuedThreadPool(100));
client.setConnectorType(HttpClient.CONNECTOR_SELECT_CHANNEL);
client.setMaxRetries(retries);
and the call below always takes ~400ms which seems way to long for an async call. To clarify I am not worried about the response time of the request. Just the method call keeps my thread busy for 400ms. It seems this method is blocking somewhere but it should be async.
client.send(httpExchange);
Am I messing up my configuration some how?
I haven’t had time to test this, but I suspect your fix is
It would appear, that by default, an HttpClient blocks on connect – even if the connector is non-blocking for the send/receive of the request+response.
(That assumes Jetty 7. I haven’t checked for Jetty 8)