[rabbitmq-discuss] Subscribe to remote rabbitmq queue

Sridhar Raman sridhar.raman at gmail.com
Wed Sep 9 08:54:02 BST 2009


When I run it, this is the error I get:
*/usr/local/lib/ruby/gems/1.8/gems/tmm1-amqp-0.6.4/lib/amqp/client.rb:65:in
`initialize': Could not connect to server hostname:5672 (AMQP::Error)
    from
/usr/local/lib/ruby/gems/1.8/gems/tmm1-amqp-0.6.4/lib/amqp/client.rb:97:in
`call'
    from
/usr/local/lib/ruby/gems/1.8/gems/tmm1-amqp-0.6.4/lib/amqp/client.rb:97:in
`unbind'
    from
/usr/local/lib/ruby/gems/1.8/gems/eventmachine-0.12.8/lib/eventmachine.rb:995:in
`call'
    from
/usr/local/lib/ruby/gems/1.8/gems/eventmachine-0.12.8/lib/eventmachine.rb:995:in
`run_deferred_callbacks'
    from
/usr/local/lib/ruby/gems/1.8/gems/eventmachine-0.12.8/lib/eventmachine.rb:995:in
`times'
    from
/usr/local/lib/ruby/gems/1.8/gems/eventmachine-0.12.8/lib/eventmachine.rb:995:in
`run_deferred_callbacks'
    from
/usr/local/lib/ruby/gems/1.8/gems/eventmachine-0.12.8/lib/eventmachine.rb:242:in
`run_machine'
    from
/usr/local/lib/ruby/gems/1.8/gems/eventmachine-0.12.8/lib/eventmachine.rb:242:in
`run'
    from /usr/local/lib/ruby/gems/1.8/gems/tmm1-amqp-0.6.4/lib/amqp.rb:84:in
`start'
    from test_processor.rb:7*

Could it because port 5672 is not accessible from outside?  In that case,
how do I expose it?
I tried iptables like this:
*iptables -A INPUT -p tcp --dport 5672 -j ACCEPT*

But still no luck.  How do I configure rabbitmq to accept requests from
external IPs?

-S

2009/9/9 Paul Jones <pauljones23 at gmail.com>

> 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/4258da45/attachment.htm 


More information about the rabbitmq-discuss mailing list