Hi,
when a HttpAsyncClient is created I observe that for each client Java
creates 3 Threads (see sample code below) and opens 6 TCP connection
endpoints (this I observed by using TCPView from sysinternals) .
These tcp connections seemed to be only used for local communication.
If a request is send via the execute method another TCP connection is
opened.
I tracked those down to be created by the
PoolingNHttpClientConnectionManager class. Is there a way to use a
HttpAsyncClient without doing any pooling?
For my purposes one client should only use 1 tcp connection endpoint
(instead of 7).
Regards,
Simon Kulessa
-----------------------------
Sample Code:
public static CloseableHttpAsyncClient createSimpleClient() {
CloseableHttpAsyncClient httpclient =
HttpAsyncClients.custom()
.build();
return httpclient;
}
public static void main(String[] args) throws IOException {
List<CloseableHttpAsyncClient> clients = new
ArrayList<CloseableHttpAsyncClient>();
for (int i = 0; i < 10; i++) {
System.out.println(i + "\t" + Thread.activeCount());
CloseableHttpAsyncClient client = createSimpleClient();
client.start();
clients.add(client);
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
System.out.println(Thread.activeCount());
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]