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?
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?
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?
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.