Skip to content

Instantly share code, notes, and snippets.

Avatar

Ben Browning bbrowning

  • Red Hat
  • Brevard, NC
View GitHub Profile
View node_handler.rb
class NodeHandler
def process!(message)
payload = message.decode[:message]
puts payload.to_yaml
queue = TorqueBox::Messaging::Queue.new("/queues/node")
queue.publish('OK', :correlation_id => message.jmsmessage_id)
end
end
View destination_spec.rb
it "should be able to publish to and receive from a topic" do
topic = TorqueBox::Messaging::Topic.new "/topics/foo"
topic.start
latch = java.util.concurrent.CountDownLatch.new(1)
t1 = Thread.new { topic.publish "howdy"; latch.countDown }
latch.await
message = topic.receive
topic.destroy