[rabbitmq-discuss] Subscribe to remote rabbitmq queue

Sridhar Raman sridhar.raman at gmail.com
Wed Sep 9 08:46:11 BST 2009


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)
EM.run {
  $amq = MQ.new
  EM.start_server "", 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

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