【问题标题】:Spring-boot : Set Timeout on REST @ Server SideSpring-boot:在 REST @ 服务器端设置超时
【发布时间】:2023-03-06 04:31:01
【问题描述】:

Spring-boot 应用程序部署在 IBM Liberty Server 上。

虽然调用客户端可以为请求设置超时,但我希望在服务器端为传入的 HTTP 请求设置超时。

我试过ConfigurableEmbeddedServletContainer setTimeout,但它不起作用。 我看错了吗?我是否必须在 Liberty Server 上设置一些属性才能使这些 Http 线程过期?

【问题讨论】:

  • 您能否回答一下您是如何做到这一点的?

标签: rest spring-boot resteasy websphere-liberty


【解决方案1】:

您的场景似乎类似于Spring Boot REST API - request timeout?

你可以尝试两件事:

  1. 按照 Danylo 的建议使用 server.connection-timeout=5000

  2. 按照 Cyril 的建议,使用 spring.mvc.async.request-timeout=5000 并返回 Callable

【讨论】:

    猜你喜欢
    • 2021-07-11
    • 2019-03-01
    • 1970-01-01
    • 2019-06-02
    • 2013-01-14
    • 1970-01-01
    • 1970-01-01
    • 2017-02-22
    • 1970-01-01
    相关资源
    最近更新 更多