-
1. Re: HttpEventServlet event() method never called if using mod_cluster
cshear Oct 22, 2010 9:51 PM (in response to cshear)I'm tracing the jbossweb source code and trying to see why my comet servlet.event() method not getting called when using mod_cluster. It seems if the comet flag is set to true, the code should definitely treat my servlet as comet servlet.
Does mod_cluster support comet servlet?
In a separate thread in the discussion forum, someone says the loadbalancing policy of mod_cluster is based on the nubmer of serving threads. In the case of NIO/APR based servlets, how can mod_cluster use the number of serving threads as an indication of loads, since NIO is event driven - there are not as many threads as a regular type of servlet can generate?
-
2. Re: HttpEventServlet event() method never called if using mod_cluster
jfclere Oct 28, 2010 2:59 AM (in response to cshear)You need to use the flushPackets/flushWait (See http://docs.jboss.org/mod_cluster/1.1.0/html/java.properties.html#proxy).
But using events through a proxy is not something that works easly.
-
3. Re: HttpEventServlet event() method never called if using mod_cluster
cshear Oct 28, 2010 2:20 PM (in response to jfclere)I set the flushPackets to true, flushWait to 0, but it does not seem to make any difference - I 'm still not getting HttpEventServlet.event() called. Only servlet.init() gets called. How to make mod_cluster module work with HttpEventServlet?
I'm starting to give up on mod_cluster. Do you know if mod_jk will work with HttpEventServlet for comet applications?
-
4. Re: HttpEventServlet event() method never called if using mod_cluster
cshear Oct 28, 2010 11:22 PM (in response to jfclere)I tried to debug the problem, at line 1006 of org.apache.catalina.core.StandardWrapper.class:
servlet = (Servlet) instanceManager.newInstance(actualClass);
instanceManager is a org.jboss.web.tomcat.service.TomcatInjectionContainer.
For whatever reason, it returns a servlet type, not a HttpEventServlet.
Can anyone help how mod_cluster can work with a HttpEventServlet?
-
5. Re: HttpEventServlet event() method never called if using mod_cluster
cshear Nov 11, 2010 10:02 PM (in response to cshear)Just to benefit other people who are sufferring from the same problem, I have found a solution that will meet my need. I used HAProxy by http://haproxy.1wt.eu/ . HAProxy can successfully load-balance my http requests as well as forwarding server comet event messages from HttpEventServlet to http clients. In addition, for this to work, you will need to patch jbossweb with the following patch I created at: http://community.jboss.org/thread/149299 for the java.lang.IllegalArgumentException on JBOSS bug. This bug fixes the NIO problem.