I have a method, I want to run two threads at a time.
The following is the method
@PostMapping(value = "/sendmails")
public ResponseEntity<Object> sendEmails(@RequestParam("file") MultipartFile reapExcelDataFile) {
bulkMailProcessor.processor(reapExcelDataFile);
return ResponseEntity.status(HttpStatus.OK).build();
}
I want to run bulkMailProcessor.processor(reapExcelDataFile); line and I don't want to wait until the process completed of the mails sending, the main thread need to continue to send mails but another thread need to start and send the result back. How can I achieve this functionality.