I have a scenario in our Web Application.
GUI invokes a REST web wervice and further web service calls a procedure. However, the procedure returns data properly for most of the scenarios. In some scenarios it takes more than 5 minutes and a session timeout happens. Now client suggested that in this case if any procedure takes more than 2 mins then it should return to GUI with a message "XLS WILL BE SENT VIA EMAIL" and when procedure returns the data (let's say, after 10 mins) then it should mail the XLS file to requested mail Id.
I have one approach as of now.
To implement a check while procedure call starts and if it crosses 2 minutes then it will invoke another REST service and from existing service message will be returned. Now from second web service it will mail the XLS file.
But this approach will take more time 2 mins + 10 mins (Procedure response).
Please guide me best approach for this implementation.
Please note GUI Team , Web Service Team and Database Team are different and works in different organizations.