def run
conn = get_connection()
raise "Unexpected protocol level" if conn.protocol != Stomp::SPL_11
qname = "/queue/nodea.nodeb.nodec"
uuid = conn.uuid()
puts "Subscribe id: #{uuid}"
conn.subscribe qname, {'id' => uuid, 'ack' => 'client'}
1.upto(nmsgs()) do
received = conn.receive
puts "Received data: #{received.body}"
msgid = received.headers['message-id']
begin
conn.ack msgid
rescue RuntimeError => sre
puts "Rescue: #{sre}, #{sre.message}"
end
conn.ack msgid, {'subscription' => uuid}
puts "ACK - msgid: #{msgid}, subscription: #{uuid}"
end
conn.unsubscribe qname, {}, uuid
conn.disconnect
end