Quantcast
Channel: Active questions tagged config - Stack Overflow
Viewing all articles
Browse latest Browse all 5049

springboot web request timeout setting

$
0
0

I wanna set a time to resolve a method cost too many time.
I try some config in application.yml but doesn't work. I hope it can return some err but it return "true"

server:  tomcat:    connection-timeout: 1sspring:  mvc:    async:      request-timeout: 1s

this is my test controller

@RestController@RequestMapping("/test")public class TimeoutTest {    @RequestMapping("/test")    public String test() {        try {            System.out.println("start");            Thread.sleep(3000);            System.out.println("end");        } catch (InterruptedException e) {            e.printStackTrace();        }        return "true";    }}

how can I do? and what's means about those tow doesn't work config?


Viewing all articles
Browse latest Browse all 5049

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>