11 Replies Latest reply on Sep 2, 2009 4:12 AM by ova

    Questions to a4j:push

    ova

      Hi experts,

      What is aj4:push exactly? It's Long Polling http://weblogs.java.net/blog/jfarcand/archive/Presentation2.jpg
      or HTTP-Streaming http://weblogs.java.net/blog/jfarcand/archive/Presentation3.jpg? I think, it's the Long Polling. Right?

      In the article "Using RichFaces Push and DataTable Ajax Keys for Partial Tables Updates" http://in.relation.to/Bloggers/Ilya was described how table cells can be updated. Could be a table partial updated if any rows have been added / deleted?

      What will be happen in the example if the aj4:push interval would be greater than Thread.sleep? I think, within 10 sek. will be nothing requested by aj4:push. Right?

      Is it possible to make something like for a tree to update any tree nodes? Can you provide an example?

      Thanks a lot!
      Oleg.

        • 1. Re: Questions to a4j:push
          ilya_shaikovsky

           

          "ova" wrote:
          ...
          In the article "Using RichFaces Push and DataTable Ajax Keys for Partial Tables Updates" http://in.relation.to/Bloggers/Ilya was described how table cells can be updated. Could be a table partial updated if any rows have been added / deleted?

          Currently not possible. In case rows added/deleted you should update the whole table.

          "ova" wrote:
          ...
          What will be happen in the example if the aj4:push interval would be greater than Thread.sleep? I think, within 10 sek. will be nothing requested by aj4:push. Right?

          Data will be requested only ater event risen and head request grabbed it.

          "ova" wrote:
          ...
          Is it possible to make something like for a tree to update any tree nodes? Can you provide an example?
          ..
          Oleg.

          Yes the tree also could be partially updated via ajaxKeys.
          https://jira.jboss.org/jira/browse/RFPL-104

          • 2. Re: Questions to a4j:push
            ova

            Ilya, thank you very much for an explanation!

            I have understand that a4j:push works more or less according to "long polling" method in which the timeout can be controled by inverval attribute. I mean, if the user is leaving the current page the last a4j:push request will be hold max. time given in a4j:push interval and than closed and commited. Right?

            Thanks in advance for a tree sample. Post here a short message please if this sample is finished.

            Best regards.
            Oleg.



            • 3. Re: Questions to a4j:push
              ilya_shaikovsky

              1) If you leaving the page - no more request will be sent for sure. Or I still not understand the question?

              2) just add yourself to issue watchers.

              • 4. Re: Questions to a4j:push
                ova

                Hi Ilya,

                The question was how long the request object is parked (HTTP connection is kept alive and request is not committed). The request object is resumed (HTTP connection is closed and request is committed) only when the server have new data to push or the interval of a4j:push is expired. Right? I was not sure how long (max. time) will be opened HTTP connection kept alive.

                Best regards. Oleg.

                • 5. Re: Questions to a4j:push
                  ova

                  sorry, not request, response is committed / not committed.

                  • 6. Re: Questions to a4j:push
                    ilya_shaikovsky

                    check livedemo example using fireBug (NET tab). we not keep the connection opened. head request just ping the server every "interval" in milis and we check if the event was risen.

                    • 7. Re: Questions to a4j:push
                      ova

                      Okey. What is happen with the request when the event was not risen? Is there difference to a4j:poll?

                      • 8. Re: Questions to a4j:push
                        ova

                        This is not Comet technique. You simulates push technique. The difference between a4j:poll and a4j:push is not really significant. The first problem with this approach is scalability. The number of requests made to the server can be extremely high if the frequency of polling is set to a small value. The performance of that application might be extremely bad. Not only the server but also the network can become killed with all those requests. The second problem - sometimes if there is no data on the server, the response will not contains any data. Doing such "void" request overload the server for nothing.

                        I am looking for pure Comet approaches for collaboration tools in social networks (with support many simultaneous users). There are already Atmosphere and Cometd frameworks built on Java NIO.

                        I read, ICEFaces uses push technique too. I think they really use long polling / http streaming (integrated with Grizzly) http://www.slideshare.net/pelegri/icefaces-and-jsf-20-on-glassfish

                        • 9. Re: Questions to a4j:push
                          nbelaevski

                          Hi Oleg,

                          Please check this article: http://docs.google.com/View?docid=ddmtrs6k_10hnrmff

                          • 10. Re: Questions to a4j:push
                            ova

                            Hi Nick,

                            Thanks a lot for your link!

                            Well. The most "Existing Technique Weakness" according to this article were already solved. Look into these pages
                            http://www.icefaces.org/main/ajax-java/push-server.iface
                            http://www.icefaces.org/main/ajax-java/enterprise-push-server.iface

                            RichFaces a4j:push component sends HEAD requests and then sends a POST request if some changes are available. I think, this is a good approach. But I see in web debigging tool (firebug or fiddler2) that some HEAD request take a long time (even more as POST). So we don't get a really advantage by this technique. E.g. the next HEAD request after POST takes always long. Why? Do you have an idea? We have a firewall in the company.

                            I also have discovered a small bug on the demo page to the a4j:push
                            http://livedemo.exadel.com/richfaces-demo/richfaces/push.jsf?c=push&tab=usage. After press "stop" button the HEAD requests are still sending. They will be never stopped! Is it a bug or what?

                            Best regards.
                            Oleg.

                            • 11. Re: Questions to a4j:push
                              ova

                              In addition, HEAD requests produce an overhead in HTTPS environment (handshakes, etc.). It's unacceptable for HTTPS connections and thousand users. I don't believe that it's better as really HTTP server push. Gmail uses e.g. HTTP-Streaming and it works great behind firewalls and proxys.