Using the class RestTemplateBuilder it is very easy to configure the RestTemplate you need.

Here is a snippet that shows you how to configure the read timeout on a RestTemplate instance.

NB: you can set timeouts in java.time.Duration (instead of int) since Spring Boot 2.1

public class MyRestClient {

  private Duration readTimeout;

  private RestTemplate restTemplate;

  public MyRestClient(RestTemplateBuilder restTemplateBuilder) {
     this.restTemplate = restTemplateBuilder
  // Code that actually uses RestTemplate...

Then you just have to set the value of the property "" (instead of hardcoding it)