We have a REST
based server and the issue is that some resources take long time to create - take couple of minutes<10m.
The problem: is that by the time the resource is created I am getting request timeout error on the client instead getting the resource back.
I thought of couple of possibilities
Create the resource with the
POST
request and add it to the session/db and then send a GET request to get the resource back. I dont like this solution: it is not "REST", and I will have to send couple of get requests that will return 404 until the resource is fully createdSet my server (Tomcat 7 & Spring 3.2) with a longer session time out duration - I dont really know how to do it.
Is there a way for the server to send a response to client saying "Hold it" until he returns the final answer? - Dont really know how to do that
Is there a way to send a request that simply "waits" longer to the server to respond? Dont really know how to do that
What is the best practice around this issue?
Thanks