users@glassfish.java.net

Re: mod_proxy blocking my Comet HTTP streaming response

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Fri, 23 May 2008 12:41:15 -0400

Salut,

Xu Erdong wrote:
> Hi,
>
> Because mod_jk doesn't support Comet in Glassfish v2 ur2, I tried
> mod_proxy instead of mod_jk to put Apache Httpd front of Glassfish for
> load balancing. In normal http request/response, it works well. But in
> Comet HTTP streaming, I found mod_proxy blocked the response until
> server close the stream (after timeout), then send the whole response to
> client at once. That's not my need, I need hold a long HTTP connection
> between client and server, and client will receive messages all the time
> from server.
> My mod_proxy configuration in httpd.conf is:
>
> ProxyPreserveHost on
> RewriteEngine on
>
> RewriteRule ^/comet$ /comet/ [R,L]
> RewriteRule ^/comet/(.*) http://localhost:8080/comet/$1 [P,L]
>
> that followed the instruction in
> http://www.manorrock.com/documents/glassfish/proxy.html, and my test
> environment is RHEL 5.1, Apache Httpd 2.2.3, Glassfish v2 ur2.
> If anyone resolved this problem, please tell me the solution.

euh....I don't know enough about mod_proxy but there must be a way to
configure it. Let me ping someone from there and I will come back. For
now, why not trying long polling instead of streaming? Once your IE
problems will be fixed (and mod_proxy), you can easily switch to
streaming by commenting the CometContext.resumeCometHandler(..). This
way you aren't blocked.

What do you think?

A+

-- Jeanfrancois


> Thanks!
>
> --
> Best regards,
> Xu mailto:xuerdong_at_gmail.com <mailto:xuerdong_at_gmail.com>