Uploaded image for project: 'ActiveMQ Apollo (Retired)'
  1. ActiveMQ Apollo (Retired)
  2. APLO-199

Can not consume many messages on Web Sockets protocol

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.2
    • 1.4
    • apollo-broker, apollo-stomp
    • None
    • Google Chrome 19.0.1084.30 (Official Build 132762) beta
      OS Linux
      WebKit 536.5 (@114489)
      JavaScript V8 3.9.24.14

    Description

      An user reported a bug on stomp-websocket which was expecting only 1 STOMP frame for each Web Socket messages.

      I fixed it to ensure that the JavaScript library can acccept many STOMP frames in a single Web Socket message: https://github.com/jmesnil/stomp-websocket/blob/multiple_stomp_frames/dist/stomp.js

      However, even with that fix, I am not able to consume many messages sent to the Web browser.

      Steps to reproduce:

      • use Apollo websocket example
      • replace its js/stomp.js by the one with the fix: https://github.com/jmesnil/stomp-websocket/blob/multiple_stomp_frames/dist/stomp.js
      • run the attached python script (which uses stomp.py library)
        $ python publisher.py
        => OK the chat will consume the 300 produced messages + a SHUTDOWN message
      • update the publisher.py and change messages to 100000
      • run again the attached python script
        => FAIL the chat will consume only 344 or so messages (all from a single Web Sockets message)
        => the publisher.py blocks after sending 8,874 messages and does not send all the expected messages

      fiy, the Apollo web sockets example used default ack for the subscriber ('auto')

      I am not sure whether the bug is in my JavaScript library or in Apollo but the publisher being stuck looks fishy.
      Afaict, the Web browser receives only a single Web Socket message from the broker. I added debug traces at the very top when I receive a WebSockets frames and I see only 1 containing STOMP MESSAGE frames.

      The REST management API gives me these info

      1. WebSocket consumer:

      Protocol Info

      protocol: stomp
      protocol version: 1.0
      protocol session id: mybroker-6e
      user: admin
      subscription count: 1
      waiting on: client request
      Metrics

      messages received from the client: 0
      messages sent to the client: 344

      1. Python producer

      Protocol Info

      protocol: stomp
      protocol version: 1.0
      protocol session id: mybroker-6f
      user: admin
      subscription count: 0
      waiting on: blocked sending to: stomp subscription id: sub-0, remote address: /127.0.0.1:36973 (via topic:chat.general)
      Metrics

      messages received from the client: 8,874
      messages sent to the client: 0

      Attachments

        1. publisher.py
          0.8 kB
          Jeff Mesnil

        Issue Links

          Activity

            People

              chirino Hiram R. Chirino
              jmesnil Jeff Mesnil
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: