posted 7 years ago
I have a design problem to solve where my application is developed using Springs.
There is a REST api which have to be designed in the following way.
Process request and call an external web service and get the results.
Start processing
-> Call External Web Service in async way. External service will inform main request once completes if main request is still alive.
-> Continue to process main request.
-> Check if async process completes in next 100millisec
-> If results arrived, return Status 201 with new URI to get complete results.
-> If external service is not complete, return Client with Status 202 asking client to call back after some time.
I am thinking on how to achieve this solution. I know we might have many solutions.
But can i have some good approach/suggestions in achieving this? Not very detailed.
Please let me know if you need any more details on this if it is not clear.