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:
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.