I'm still new to multi-threading and I'm not sure how to implement this. I have this Spring app that I would like to be able to send from the controller OK status when it is called say from Postman, while the method called in it still finished in the background. Can I ask for example code how to do this? Here is the method I would like to make asynchronous:
public void methodForAsynchronousTask(){
restTemplate.exchange(url, method, requestEntity, String.class);
}
And this is my controller:
@PostMapping("/")
public ResponseEntity<?> startOutage() {
someClass.methodForAsynchronousTask();
return new ResponseEntity<>(HttpStatus.OK);
}