HttpComponentsMessageSender - Default max total connection

1.5k views Asked by At

I am setting HttpComponentsMessageSender as messageSender for WebserviceTemplate. What is the maxTotalConnections that HttpComponentsMessageSender has by default? Will it cause the webservice connection to external services to wait if it reaches the max connections defined?

1

There are 1 answers

0
Lance On

Yes, they will wait.

The default for maxTotalConnections is set to twenty by default. The maximum number of connections per route is set to two by default.

Should all of the connections be used the httpClient will put your request in waiters. Your server will stop handling requests.

enter image description here

Here you can see that there is no available connections, connCount == 200 (maxPoolSize) and it prevents from creating new connections. All new outgoing requests for a connection will go into into the waiters queue. Once a connection becomes available the queue will start moving.