在处理请求之前无法发送针对帖子请求的响应
我尝试使用@Enableasync批注和Webasynctask,但是没有运气
@RequestMapping(method = RequestMethod.POST, value = "/leagues")
public WebAsyncTask<String> addLeague(@RequestBody FootballLeagues footballLeagues) {
Callable<String> callable = () -> {
Thread.sleep(2000);
logger.info("Inside Callable");
return "Request Received";
};
logger.info("Outside Callable");
return new WebAsyncTask<String>(10000, callable);
}
一旦发布请求,我想立即向用户发送响应消息,然后执行其他处理