I'm learning about RestTemplate in Spring Boot project and I want to log the value of connectTimeout property.
To set this value I can do this implementation:
HttpComponentsClientHttpRequestFactory rf =
(HttpComponentsClientHttpRequestFactory) restTemplate.getRequestFactory();
rf.setConnectTimeout(3000);
But I want to set it in application.yml like this:
communication:
http:
client:
connectTimeout: '3000'
And then, in the configuration class I want to log this value. How can I do this to obtain the value of the connectTimeout in the configuration class? I cannot do rf.getConnectTimeout();
because this method doesn't exist.
And another question, how Spring set up this connectTimeout value that I added it in the application.yml? Any feedback will be apreciated!