【发布时间】:2025-11-22 23:20:03
【问题描述】:
我有一个码头服务器,它被配置为在 30 秒后过期请求,这是 xml 配置文件中的配置行:
<Set name="maxIdleTime">30000</Set>
此服务器接受两种请求:必须实时处理的请求和来自批处理脚本的请求,这些请求可能需要一些时间才能得到答复。
一个请求预计最多需要几分钟。 现在我想让这个请求在不超时的情况下完全执行,同时保持“正常”实时请求的到期时间较短,以避免潜在的拥塞。
我的猜测是我必须这样做:
public class MyServlet extends HttpServlet {
...
public void doGet(HttpServletRequest pRequest, HttpServletResponse pResponse)
throws IOException, ServletException {
if (pRequest is of the type allowed to be slow) {
set max idle time for this request very high (or infinite)
}
server.execute(pRequest, pResponse);
}
}
我正在使用码头 6.1.2rc4
【问题讨论】: