Home » Java » java – Multiple thread in Rest Web Service-Exceptionshub

java – Multiple thread in Rest Web Service-Exceptionshub

Posted by: admin February 25, 2020 Leave a comment


I have a scenario in our Web Application.

GUI invokes a Rest Web Service and further Web Service call a Procedure. However Procedure returns data properly for most of the scenarios. In some Scenario it takes more than 5 mins and 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 Say after 10 mins) then it should mail the xls to requested mail Id.

I have one approach as of now.

To implement a check while procedure call starts and if it crosses 2 mins 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.

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.

How to&Answers: