Uploaded image for project: 'RichFaces'
  1. RichFaces
  2. RF-14080

a4j:push not using websockets and falling back to long-polling

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Rejected
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Environment:

      Richfaces 4.2.2, Atmosphere 0.8.4, JBoss 8.2.0 (Wildfly)

    • Steps to Reproduce:
      Hide

      Perform configuration as described in Description. Issue can be seen easily

      Show
      Perform configuration as described in Description. Issue can be seen easily

      Description

      I am using Richfaces 4.2.2 for my project and from https://developer.jboss.org/wiki/StartingWithRichFacesPushOnVariousServletContainers, figured out that atmosphere 0.8.4 needs to be used for compatibility. I am able to get push working but it is using long-polling instead of websockets. Webserver is Jboss 8.2 (undertow).

      Following configurations were done to achieve this:

      <context-param>
      <param-name>org.richfaces.push.initializeOnStartup</param-name>
      <param-value>true</param-value>
      </context-param>

      On server side, push notifications are send to client using

      TopicKey topicKey = new TopicKey(key);
      TopicsContext topicsContext = TopicsContext.lookup();
      topicsContext.publish(topicKey, message);
      On client side, notifications are received as. I have added script block to use transport for push as websocket, but it seems to be failing.

      <script>
      RichFaces.Push.transport = "websocket";
      RichFaces.Push.fallbackTransport = "long-polling";
      </script>

      <a4j:region>
      <a4j:push address="update">
      <a4j:ajax event="dataavailable" render="someelements"/>
      </a4j:push>
      </a4j:region>
      Can anyone guide me along with the missing configurations? OR it is the limitation with the current version of richfaces/atmosphere that long-polling is the only supported transport mechanism?

      Error reported as seen on javascript console is:
      Firefox can't establish a connection to the server at ws://localhost/test/_richfaces_push?_richfacesPushAsync=1&pushSessionId=d7adb280-eb7c-4550-81b1-24e691e552e2

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                guptaamit Amit Gupta
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: