Jeff Mesnil
Weblog · About

STOMP Over WebSockets With Multiple Frames

May 15, 2012

I updated stomp-websocket JavaScript library to fix a critical bug.

When it receives a WebSocket message, I was parsing it to unmarshall a single STOMP frame. However it is valid to send many STOMP frames in a single WebSocket message (ActiveMQ Apollo does this). I updated the code to take this into account (and check for content-length header too).

This should considerably improve the performance when consuming STOMP messages from the Web browsers.

Thanks to rfox90 which proposed a solution to this fix and Jeff Robbins which tested it on many STOMP brokers to validate it.

The latest version of the library is available on GitHub.