We are trying to invoke a rest API from UAT but the API is inaccessible due to firewall restrictions. While the appropriate team sorts this out, we have the requirement to show a meaningful message. e.g. System unavailable or timeout etc. We have timeout of 5000 ms defined in the rest rule but it is not working in this scenario.
Right now when invoked, the system is freezing and gets hung. The log is full of requestor locked and socket timeout exceptions before finally throwing a connection refused message after few minutes . Please advise how to show the terminate the rest connection and show a meaningful message and not let the system clok in front of the user. Logs attached.
1. Response Timeout value (milliseconds) is just a threshold value like "when do I give up?"
2. It is a best practise to have threshold value not more than 1-2 mins.
3. If your external rest service taking up longer time to respond, let’s say 5 mins, it is not that advisable to keep response timeout value to 5 mins, as the user just have to wait for 5 mins on the same screen. (Consider fine-tuning the REST service).
4. In the above case (5mins) there might be a chance of getting a thread hung as the thread will go into the activity code and will have to wait on that.
5. Consider using data pages where you can source it from Connect-REST service and define your refresh strategies to load the data when required.