Implementation of an controller with asyncronous processing. This is a good solution for whenever a long pooling is needed.
@RequestMapping(method = RequestMethod.PUT, path="xxx/yyy/{yyy}")
public Callable<string> processProductImage2(HttpServletRequest request , @PathVariable("yyy") Integer yyy) {
(...)
Callable<string> callable = () -> {
(...) //
long process (...)
return "ok";
};
// return results to the caller return callable;
}
Notes: