title: Java Rest service - respond accepted and process requestbehind
body: <p>I would like to write a java rest service which accept the request, respond immediately with 200 or 202 and process the request behind the scene. the user doesnt have to wait for the whole process to be completed. please suggest</p>
  
  <p><strong>my rest controller class</strong> </p>
  
  <pre><code> @Override
    public Response generateReport(Request requst) {
       return service.generateReport(requst);
    }
  </code></pre>
  
  <p><strong>Service class :</strong></p>
  
  <pre><code>@Override
  @Async
  public Response generateReport(Request requst) {
       generateReport(requst);
       return Response.ok().build();
    }
  
  
  public void generateReport(Request requst) {
      &lt;!-- login to process the request. it will take 15 mins to complete --&gt;
    }
  
  </code></pre>