Request timeout for endpoint using StreamingResponseBody in Spring

Viewed 628

I have a spring MVC endpoint returning StreamingResponseBody so I can stream big file instead of keeping it in memory.

The request can take a while to download so it is timing out. I can fix it by setting spring.mvc.async.request-timeout=360000, but I don't want this setting to apply globally to all endpoints.

Is there way to set request-timeout only for this specific endpoint?

I did find Set timeout for specific async request in Spring-boot, but I don't think that applies to my code using StreamingResponseBody.

I have also found Spring REST endpoint returning StreamingResponseBody: AsyncRequestTimeoutException after 30 seconds, which doesn't have the desired effect.

0 Answers
Related