benjaminws / stomp-js

Implementation of the STOMP protocol in node.js
BSD 3-Clause "New" or "Revised" License
87 stars 47 forks source link

Large queues cause partial read on 'data' event #1

Closed benjaminws closed 13 years ago

benjaminws commented 13 years ago

When a large queue is polled for data, only partial data is received when the 'data' event is fired. Likely due to an OS buffer limit.

Maybe need to buffer the partial data chunk and ensure we only parse complete frames. The rest of the messages should be left on the queue if not ack'd.

In the case of ActiveMQ, you can limit the number of messages that are returned by server with the 'activemq.prefetchSize' header when subscribing. That works around the problem there.

benjaminws commented 13 years ago

Fixed in https://github.com/benjaminws/stomp-js/commit/3c1b46f8e7fcc05122b8deea99fb4b35c1ad69b2