2

I am working on a rest service, and the sample code I have written is as shown below.

@RestController
public class ProjectController{
@RequestMapping(value = "registerProject")
public ResponseEntity registerProject(@RequestBody Project project){
  ProcessProject pp = new processProject();
  pp.process(project);
  return new ResponseEntity<>(null, HttpStatus.OK);
}
}

The above code gets invoked on "/registerProject" and receives "project" object as a request body. Upon receiving this "project" object, "process(project)" method of "ProcessProject" class is invoked. Now the requirement is the controller should not wait untill the "process(project)" method completes its execution, and it should return back the ResponseEntity object. Kindly help me out in achieving this scenario. Thanks in advance.

Pramod
  • 731
  • 2
  • 10
  • 24

0 Answers0