Tomcat CometProcessor NIO 通过 Apache httpd 提供服务?

发布于 2024-08-11 10:40:52 字数 825 浏览 3 评论 0原文

我有一个 CometProcessor Servlet 在 Apache Tomcat 中工作正常。 我的 server.xml 连接器条目是:

<Connector connectionTimeout="20000" port="8080" protocol="org.apache.coyote.http11.Http11NioProtocol" redirectPort="8443"/>

我可以直接使用 Tomcat 的 URL 访问 servlet(名为“EventBus”),如下所示:

http://xyz.com:8080/EventBus

我有 Apache httpd 提供 .jsp 文件和 servlet,其中带有基本的workers.properties 文件,其工作人员如下:

worker.ajp13w.type=ajp13
worker.ajp13w.host=localhost
worker.ajp13w.port=8009

这适用于除我的 CometProcessor servlet 之外的所有内容。当我尝试访问这个 servlet 时,我得到:

HTTP method GET is not supported by this URL

有谁知道如何正确地将请求从 Apache httpd 转发到 Apache Tomcat 以实现像 CometProcessor 这样的 NIO 连接?

感谢您的任何帮助。

I have a CometProcessor Servlet working fine in Apache Tomcat.
My server.xml connector entry is:

<Connector connectionTimeout="20000" port="8080" protocol="org.apache.coyote.http11.Http11NioProtocol" redirectPort="8443"/>

I can hit the servlet (named 'EventBus') with a URL to Tomcat directly like so:

http://xyz.com:8080/EventBus

I have Apache httpd serving up .jsp files and servlets with a basic workers.properties file with a worker like:

worker.ajp13w.type=ajp13
worker.ajp13w.host=localhost
worker.ajp13w.port=8009

This works fine with everything but my CometProcessor servlet. When I try to hit this servlet I get:

HTTP method GET is not supported by this URL

Does anyone know how to properly forward requests from Apache httpd to Apache Tomcat for an NIO connection like a CometProcessor?

Thanks for any help.

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

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

发布评论

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

评论(1

樱娆 2024-08-18 10:40:52

我认为您不能将 CometProcessor 与 Apache 一起使用。 CometProcessor 需要异步 I/O,通过 Apache httpd 不可能做到这一点。

JK 不能确定工作,因为只有 APR 和 NIO 连接器支持 CometProcessor。

您也许可以使用 mod_proxy 将连接转发到 NIO 连接器,但您不会异步获取事件。

I don't think you can use CometProcessor with Apache. CometProcessor requires asynchronous I/O, it's impossible doing this through Apache httpd.

JK doesn't work for sure because only APR and NIO connectors supports CometProcessor.

You might be able to use mod_proxy to forward the connection to your NIO connector but you would not get event asynchronously.

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