I'm trying to convert the following method using WebFlux to avoid using @Async on the same.
@Async
@Override
public void notifyCallback(NotifyCallbackRequest request, String id) {
startProcess(id);
}
Controller class:
@ResponseStatus(HttpStatus.OK)
@PostMapping("/notify-status/{id}")
public void notifyCallback(@PathVariable("id") String id, @RequestBody NotifyCallbackRequest request) {
identityService.notifyCallback(request, id);
}
startProcess(id) is a method that makes an api call via webflux and returns a Mono type. I am interested that the caller immediately receives a ResponseStatus (HttpStatus.OK) despite what happens next.