1 Reply Latest reply on Feb 23, 2012 3:48 AM by Szabolcs Egyeki

    a4j:push problem. It sometimes works, sometimes does not work.

    Szabolcs Egyeki Newbie

      Hello

       

      I have been trying to solve a problem that surfaced a couple of weeks ago and I am in trouble because I have not found any good solution yet.

      Our web application uses richfaces 3.3.1. and 2-500 parallel users use the web app at same time. The web app is deployed in Tomcat.

      Earlier there was only one part of the page that was updated by a4j:push if the user opened a toggle box. And it worked perfectly.

      In the new release the page has been extended and now there are 7 different toggle boxes on the page and all of them use a4j:push.

      During the testing phase we did not experience any problem but in the real system sometimes it works, sometimes it does not work (weird). But mostly it does not work

      The page has been implmented in the "standard way":

       

      XHTML code:    

                <a4j:push id="push1"

                                  timeout="1000"

                                  interval="3000"

                                  eventProducer="#{bean.addListener}"

                                  enabled="#{bean.toggleOpened}"

                                  reRender="push1, togglebox1"/>

       

      Java code:

               class PushBean {

                     private PushEventListener listener;

                     ...

                    

                     public void addListener(EventListener listener) {   

                          if (this.listener != listener) {

                               this.listener = listener;

                          }

                     }

       

                     public void updateNeeded() {

                          if (listener != null) {

                               listener.onEvent(new EventObject());

                               logger.debug("Push event is sent");

                          }

                     }

       

      So, nothing special. In the log file there are the "Push event is sent" messages so the event is sent properly.

      I monitored the network traffic in the browser and it seemd to be almost OK because the client was trying to get data from the server, but only 202 status code is arrived 200 is not.

      I think the problem is somewhere in the server side.

      In the richfaces log I found the following log entries in the real system:

       

      2012-02-13 14:49:27,801 DEBUG  org.ajax4jsf.webapp.BaseFilter - No event for a id FA0879CFF63FC16F4EAF731CA1FC33BB.worker3/stgsend/stgsend_main.xhtml:notifPush

      2012-02-13 14:49:27,801 DEBUG  org.ajax4jsf.webapp.BaseFilter - No event for a id 552135E28F104E9FAAAF2F491ADCC285.worker3/stgsend/stgsend_main.xhtml:notifDialogPush

      2012-02-13 14:49:27,801 DEBUG  org.ajax4jsf.webapp.BaseFilter - No event for a id 1932D5950AF7AEE0C660277EC651F89C.worker3/stgsend/stgsend_main.xhtml:notifPush

      2012-02-13 14:49:27,801 DEBUG  org.ajax4jsf.webapp.BaseFilter - No event for a id 6492F8FBE7CC485F3B08366D3F466B58.worker3/stgsend/stgsend_main.xhtml:notifDialogPush

       

      But I did not find any log entries like this:

      2012-02-13 14:50:06,902 DEBUG  org.ajax4jsf.webapp.BaseFilter - Occurs event for a id 17A9570F5489C01E1E31F9368B596DDD.worker3/stgsend/stgsend_main.xhtml:notifDialogPush

      When I tested it there were "occurs" logs for every onEvent() call in the testbed.

       

      I tried to set the LRU_MAP_CACHE_SIZE parameter to 5000 (its default value 100), but it did not help (7 listener * 500 user < 5000 cache size).

      Is there any other config parameter that can help to solve this problem?

      Does anybody experience similar problem like this?

      Every suggestion is welcomed, because I have already run out of the ideas.

      Regards

       

      Szabolcs