rabbitmq / rabbitmq-stomp

RabbitMQ STOMP plugin
https://www.rabbitmq.com/stomp.html
Other
49 stars 28 forks source link

Added some examples in Ruby (for #78) #79

Closed userlocalhost closed 8 years ago

userlocalhost commented 8 years ago

Here is the results of each examples that is added by this PR.

/amq/queue

https://gist.github.com/userlocalhost2000/9cd2d67a04ed8e794976

/exchange

https://gist.github.com/userlocalhost2000/0d5d002a11eb89a71fb9

/temp-queue

https://gist.github.com/userlocalhost2000/d05bbd6466a811527991

Would you please tell me the points where I should correct?

michaelklishin commented 8 years ago

Please close connections explicitly.

userlocalhost commented 8 years ago

I added a processing to close connection. PTAL.

You might wonder that the reason why I use Stomp::Connection at the temp-queue-client.rb even though most of publisher examples use Stomp::Client. This is because the restriction of stompgem/stomp gem. Stomp::Conection has interfaces to handle STOMP frames. And Stomp::Client has Stomp::Connection object internally, but this doesn't expose the interface of Stomp::Connection to receive MESSAGE frame.

So I use low level object of Stomp::Connection at the temp-queue-client.rb to do both of publishing and subscribing messages.

michaelklishin commented 8 years ago

Thank you!