Uploaded image for project: 'ActiveMQ'
  1. ActiveMQ
  2. AMQ-3660

amq.js breaks messages longer than 4KB in Firefox

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Abandoned
    • Affects Version/s: 5.5.1, 5.6.0
    • Fix Version/s: None
    • Component/s: None
    • Environment:

      Standard environment, with running ActiveMQ broker and e.g. the chat demo

      Description

      Hello,

      I report a small glitch that affects the client-side Ajax script amq.js and Firefox with big messages. It is very easy to reproduce:

      • start the ActiveMQ broker locally
      • open Firefox (I am using version 8.0.1) and another browser of your choice,
      • point both of them to the chat example and join the chat,
      • send a BIG string (more than 4096 chars) from the second browser,
      • check the length of the string that appears on Firefox: exactly 4096 chars.

      After a bit of googling I found out that Firefox limits the size of XML nodes to 4K, while in amq.js every node is handled as a separate message:

      // Loop thru and handle each <message>
      for (var j = 0; j < responseElement.childNodes.length; j++) {
          handler(responseElement.childNodes[j]);
      }
      

      I found out about the bug while sending rather large JSON strings, that obviously could not be parsed. I fixed that in my code with a quite naive patch for amq.js that "glues" nodes together in a string and handles them as a single message, but that is not always enough (e.g. the message handler in chat.js does not accept strings).

      If you guys have clever hints I will be happy to work on a patch for this.

      Ciao,
      Claudio

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                claudio.squarcella Claudio Squarcella
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: