Shahzad Bhatti Welcome to my ramblings and rants!

August 3, 2006

#!/usr/bin/env ruby -w

Filed under: Computing — admin @ 8:26 am

#!/usr/bin/env ruby -w

require ‘rubygems’
require ‘stomp’

#class Publisher < ActiveMessaging::Processor # publishes_to :ServerSideQ # #end #pub = #pub.publish :message => “Go Sox!”

client = nil, nil, “localhost”, 61613
client.subscribe(“/queue/clientSideReplyQ”, {
“persistent” => true,
“client-id” => “rubyClient”,
}) do |message|
puts “Got Reply: #{message.body} on #{message.headers[‘destination’]}”
client.ack message

for i in 1..5 do
m = “Go Sox #{i}!”
puts m
client.send(“/queue/ServerSideQ”, m, {
“persistent” => true,
“priority” => 4,
“reply-to” => “/queue/clientSideReplyQ”,
puts “Waiting for response on /queue/clientSideReplyQ”
client.close #disconnect

No Comments

No comments yet.

RSS feed for comments on this post. TrackBack URL

Sorry, the comment form is closed at this time.

Powered by WordPress