想要在处理之前发送对后处理请求的响应

时间:2019-08-11 05:43:10

标签: spring-boot-maven-plugin

在处理请求之前无法发送针对帖子请求的响应

我尝试使用@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);
    }

一旦发布请求,我想立即向用户发送响应消息,然后执行其他处理

0 个答案:

没有答案
相关问题