赞
踩
spring.mvc.async.request-timeout=20000
- @GetMapping("test")
- public String test(){
-
- try {
- Thread.sleep(60000);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- System.out.println("keep going");
- return "success";
- }
-
- @GetMapping("test2")
- public Callable<String> test2() {
- return ()-> {
- try {
- Thread.sleep(60000);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- System.out.println("keep going");
- return "foobar";
- };
- }
test不生效 test2生效
看看解释,异步请求到达之前的时间量
当20秒到了,程序睡眠中断。实际就是程序直接跳出
返回503
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。