[rabbitmq-discuss] Subscribe to remote rabbitmq queue
Sridhar Raman
sridhar.raman at gmail.com
Wed Sep 9 08:46:11 BST 2009
Hi
This is our current setup that is working in a server:
Listener (that receives the data and publishes it):
*module QueueData
def receive_data(d)
$amq.queue("queue_name").publish(d)
end
end
EM.run {
$amq = MQ.new
EM.start_server "0.0.0.0", 22003, QueueData
}*
Processor (that subscribes to the queue and processes it):
*EM.run {
amq = MQ.new
amq.queue("queue_name").subscribe { |d|
puts d
}
}*
How do I subscribe to this queue from another machine? I tried this:
*AMQP.start(:host => 'hostname', :port => 5672, :logging => true) do
puts "connected ..."
mq = MQ.new
MQ.queue('queue_name').subscribe{ |msg|
puts msg
}
end*
But it doesn't work. Any suggestions?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20090909/882521ff/attachment.htm
More information about the rabbitmq-discuss
mailing list