Reputation: 51
My operation takes 30 mins to process which is invoked by a rest call request. i want to give the client an immediate response telling operation in progress,and processing should happen in another thread, what is the best way to crack this out,Is deferred result the only way.
Upvotes: 1
Views: 1056
Reputation: 7076
Use a message queue (ActiveMQ, Redis).
Upvotes: 1
Reputation: 2043
Since you are providing rest services, another approach could be to immediately return 'Accepted' (202) or 'Created' (201) to the client and provide a link to another service that would provide updates about the progress status of the processing. This way the client is free to decide whether to poll the server for updates, or just provide the user an 'update status' button.
Upvotes: 1
Reputation: 5213
30 minutes is a long time. I'd suggest you using websocket
s to push progress updates and operation status.
Upvotes: 1