iande / onstomp

A STOMP messaging client library for Ruby
http://mathish.com/projects/onstomp.html
Other
23 stars 11 forks source link

Allow a receipt and error callback to be specified with SEND frames. #10

Open iande opened 13 years ago

iande commented 13 years ago

If a SEND frame (and perhaps others) is sent with a receipt header, ActiveMQ will set a matching receipt-id header in any ERROR frames generated as a result of the frame. Depending upon how common this behavior is amongst STOMP brokers, this could be used as part of a more specialized error handling:

client.send '/queue/testing', 'some message',
  :on_success => lambda { ... },
  :on_failure => lambda { ... }

I'm not too keen on that syntax exactly, but it conveys the idea.