stompgem / stomp

A ruby gem for sending and receiving messages from a Stomp protocol compliant message queue. Includes: failover logic, ssl support.
http://stomp.github.com
Apache License 2.0
152 stars 80 forks source link

ActiveMQ does not manage STOMP write heart beats correctly: AMQ-4710 #72

Closed PaulGale closed 10 years ago

PaulGale commented 11 years ago

I thought I would bring to the attention of the gem maintainers an issue in ActiveMQ 5.8.0 regarding a bug in its STOMP write heart beat management.

The maintainers should be aware of this bug as it will materially affect testing of the Gem.

A Jira issue was opened against ActiveMQ 5.8.0 #AMQ-4710 for which I have submitted a test and a patch. It has yet to be accepted.

The incorrect behavior ActiveMQ exhibits is that its write checker can sleep for twice (worst case) the configured sleep interval between write heart beats. This can/will confuse connected clients, potentially resulting in a false failover attempt.

Whenever the write checker wakes it checks to see if any data was sent whilst it was asleep. If so, it does nothing and goes back to sleep. This is wrong.

Example (assume the following has happened):

Current behavior:

Correct behavior:

gmallard commented 11 years ago

The AMQ issue is noted.