[rabbitmq-discuss] Subscribe to remote rabbitmq queue
Paul Jones
pauljones23 at gmail.com
Wed Sep 9 08:50:53 BST 2009
Sridhar,
Can you describe how this doesn't work?
Paul.
On Wed, Sep 9, 2009 at 8:46 AM, Sridhar Raman <sridhar.raman at gmail.com>wrote:
> 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?
>
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20090909/437a2bb7/attachment.htm
More information about the rabbitmq-discuss
mailing list