Home REST: Processing error in long running operation, how to inform clients?
Reply: 0

REST: Processing error in long running operation, how to inform clients?

user1058
1#
user1058 Published in April 25, 2018, 10:54 am

I am developing a webservice that alllows users to request validation reports. Report generation might take up to 20 hours per report. When a new validation request is posted, I return a 202 Accepted answer with Location set to a processing queue (e.g./queue/5) When the queue resource is polled some processing information is provided:

<queueResponse> <status>QUEUED</status> <queuePosition>1</queuePosition> </queueResponse>

Once processing completes successfully and the queue is polled, a 303 see other will redirect to the created resource (at /reports/5 e.g.).

However if a processing error occurs on server, i simply return my queueResponse without redirect and status set to <status>ERROR</status>.

Is this the best way to comunicate a processing error to the client? Or should instead simply a 500 Internal Server Error returned when polling the queue for a failed validation task?.....

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.340848 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO