'Spring-boot : Set Timeout on REST @ Server Side

Spring-boot application deploys on IBM Liberty Server.

Though calling client can set a timeout on the request , I want a timeout to be set on Server side for Incoming HTTP requests.

I have tried ConfigurableEmbeddedServletContainer setTimeout but it does not work. Am i looking this in a wrong way ? Do i Have to set some property on Liberty Server for expiring these Http Threads ?



Solution 1:[1]

Your scenario seems to be similar to Spring Boot REST API - request timeout?

Two things you can try:

  1. Use server.connection-timeout=5000 as suggested by Danylo

  2. Use spring.mvc.async.request-timeout=5000 and return a Callable as suggested by Cyril.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 wltheng