JAVA-064 / Intermediate
External API calls without timeouts (resource exhaustion)
Why is this a problem?
Delayed responses exhaust threads and stop the entire service.
How to fix it
java
RestTemplate rt = new RestTemplateBuilder()
.setConnectTimeout(Duration.ofSeconds(3)).setReadTimeout(Duration.ofSeconds(5)).build();