I need to understand which pros-n-cons approaches to handle asynchronous operations in REST. Some approaches that I have found:
1- Based on resources:. Status status is modeled as status. The user makes an asyn REST call (PUT, POST, etc.). Gets an Accepted or In-Progress ( 202 ) response. Additional uri status is re-processed via GET to check the status / progress / messages from the operation.
Question:. How long will this resource be active on the server? If customer surveys are at large intervals, when between activities ends, how do we return status? It looks like the execution status will remain. But how long to persist, when to archive / delete, is this such a standard approach?
2- Based on the callback:. If an Async request requires a callbackURI, the request is processed asynchronously and, upon completion, makes a callbackURI call with the status / result of the operation.
Question: It seems more elegant, less server-side overhead. But the scenarios in which the callback server is interrupted without reacting, etc., How do we deal with this? Implement typical retries in which callbackURI also provides retry configuration? Is there any other drawback to this approach?
3- Servlet 3.0 Asynchronous Support:. If the HTTP client for Java Servlet creates connections that remain open until they are explicitly closed, until the closed client server can asynchronously exchange data on it.
Question: With its Servlet 3.0 specification, I think that Jersey, Spring's REST implementation does not use this approach at the moment. Is there any specific REST implementation that uses a similar approach or a pointer to ways to make this possible?
4 Any other approaches may be commercial?