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

Fix bug with :suppress_content_length on STOMP 1.1 protocol #52

Closed jphastings closed 11 years ago

jphastings commented 11 years ago

When using STOMP 1.1 the header encoding done breaks the test for :suppress_content_length header option - preventing the gem from ever being able to send a TextMessage style message (instead always sending a ByteMessage type).

The following patch changes the STOMP header encoding method so that the keys are symbols instead of strings. This doesn't affect the message submission (as they're all converted to strings to be sent) but it allows the code in _transmit to correctly detect the :suppress_content_length header and do just that.

Also, the example in the documentation had be confused for a long time - obviously #send is a reserved method name, so now the library is using #publish, but the README.rdoc hadn't been updated. This little patch fixes that!

gmallard commented 11 years ago

Nice catch. Both of them. Thanks.