I got this error all of a sudden in production while the application was not under any load.
The issue happened when my code tries to send the PUT message using spri
Caused by: org.apache.http.conn.ConnectionPoolTimeoutException: Timeout waiting for connection from pool
This error is self describing. You need to increase your connection pool in production - current implementation of HttpComponentsClientHttpRequestFactory default constructor is using HttpClientBuilder with .useSystemProperties().
I believe it will be 5 connections by default. This works for client but is unlikely what you want in server environment. You need to use something like
new RestTemplate(new HttpComponentsClientHttpRequestFactory(HttpClientBuilder.create()
.setMaxConnTotal(200)
.setMaxConnPerRoute(50)
.build()));