A basic package for sending and receiving stomp messages


A server class will listen to topics (StompMessage::StompServer)


A class to easily send (and receive messages from the server). Since the messsage protocol is semi one way to receive a message you reply to a distinct topic and a call back is executed.

The code below creates server class and sends message/gets response.

IMPORTANT apachemq or some other messaging platform must be running :)

args==> '/topic/test'
ss=StompMessage::StompStatisticsServer.new(args)
ss_thread = Thread.new {
ss.run }

msg=StompMessage::Message.new('stomp_REPORT', "body")

puts "creating send topic"
send_topic=StompMessage::StompSendTopic.new(args)
send_topic.send_topic_acknowledge(msg,{ :msisdn => "639999"}) { |m|
puts "#mm.to_s"
msg=StompMessage::Message.load_xml(m)
assert msg.command== 'stomp_REPLY', "command wrong"
}