I am trying to call REST API from Spring MVC application using REST Template. While doing so , We have to set timeout values (connection-timeout and read-timeout) and are maintaining in YML file.
Timeouts are read from YML and are set while initializing rest template.
For E.g if I have scenario like :- connection-timeout = 5 sec , read timeout = 3 sec
My question is when read timeout will occur ?
considering worst case scenario (connection is established at 5th sec , will read timeout will occur after that meaning at 8th sec [response received at 3rd sec] ? )
Are both these timeouts are dependent on each other ?
I searched for the same however did not get answer for that as I got the information as connection timeout is for establishing the connection and read will occur while reading from connection however does read timeout value includes connection timeout value as well is not clear.
It may be basic question, however I am confused so any guidance/pointers on the same will be helpful.
Thanks !
EDIT : I have gone through the "Spring rest template readTimeOut" and it says the clock starts when the request first hits that socket and stops when whichever of these comes first: the request completes or the readTimeout is reached but I understand while establishing connection as well there will be hit to socket. Does it mean readtimeout is inclusive of connection timeout as well ?