I am new to SpringBoot and looking for a way to Timeout when endpoint takes more than 3 seconds to return the response. I tried by adding the property "server.servlet.session.timeout", but still no luck. How to achieve this? Thanks.
@GetMapping("/api")
public Data getData(){
Thread.sleep(10000);
return ....;
}
Application.properties
server.servlet.session.timeout=3s