如何在 Restlet 中使用 Jetty ThrottlingFilter

发布于 2024-07-13 03:36:29 字数 923 浏览 3 评论 0原文

我想配置一个 Web 服务,以便一旦接受队列已满,服务就会返回 503。目前,这些请求似乎只是超时。

我确实设置了诸如 ma​​xThreadsacceptQueuesize 之类的参数(如下所述:http://www.restlet.org/documentation/1.1/ext/com/noelios/restlet/ext/jetty/JettyServerHelper)。

但是一旦acceptQueue已满,服务就不会响应503。

看来jetty的ThrottingFilter(< a href="http://www.mortbay.org/jetty/jetty-6/apidocs/index.html?index-all.html" rel="nofollow noreferrer">http://www.mortbay.org/jetty /jetty-6/apidocs/index.html?index-all.html) 是我正在寻找的内容,但我不知道如何在我的 Restlet 服务中应用。

I would like to configure a webservice so that once the accept queue is full the service returns 503. Currently, these requests seem to just time out.

I did set paramters like maxThreads and acceptQueuesize (as described here: http://www.restlet.org/documentation/1.1/ext/com/noelios/restlet/ext/jetty/JettyServerHelper).

But the service does not respond with 503 once the acceptQueue is full.

It seems jetty's ThrottlingFilter (http://www.mortbay.org/jetty/jetty-6/apidocs/index.html?index-all.html) is what I'm looking for, but I don't know how to apply within my restlet service.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

花辞树 2024-07-20 03:36:29

除非您将应用程序作为 WAR 文件部署到 Jetty 中,否则您将无法利用 ThrottlingFilter。 JettyServerHelper 将 Restlet 引导为独立服务器,使用 Jetty 接受 HTTP 连接,因此无法使用 Servlet Filter。 我不确定是否可以在 Servlet 世界之外利用 Jetty 中的 ThrottlingFilter 的类似处理逻辑。

You won't be able to take advantage of ThrottlingFilter unless you deploy your application as a WAR file into Jetty. JettyServerHelper bootstraps Restlet as a standalone server using Jetty to accept HTTP connections and hence cannot utilize a Servlet Filter. I'm not sure if there is anyway to utilize similar processing logic from the ThrottlingFilter in Jetty outside of the Servlet world or not.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文