title: REST with JAX-RS - Asynchronous call
body: <p>I saw the below post from "cmd" which was posted couple of years back. And "Wojtek Owczarczyk" was answered this one. I am good with all the answer, except last line.</p>
  
  <p>My Confusion is, If we return immediately with ACCEPTED status. Then, we will lost the track of the request.</p>
  
  <p>So i am planning to implement below steps. Please correct me if i am wrong.</p>
  
  <p>1) As soon as the request hits service api - I will create one Job Id and persist my request detail and send back the client with ACCEPTED status code along with Job id.
  2) Then, i will create the new thread for that request to continue with the requested operation.
  3) After successful completion of Operation, I will send back the client with all status of the request.
  4) Finally, in callbackCompletion register i will remove the job id from my persistence list.</p>
  
  <p>To implement the above logic, i need client to send his listener information along with request (basically URI). This is to update the request status to client back, after processing the request.</p>
  
  <p><a href="https://stackoverflow.com/questions/18787825/rest-with-jax-rs-handling-long-running-operations/22201439#22201439">REST with JAX-RS - Handling long running operations</a></p>