When I run it, this is the error I get:<br><b>/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 <i>hostname</i>:5672 (AMQP::Error)<br> from /usr/local/lib/ruby/gems/1.8/gems/tmm1-amqp-0.6.4/lib/amqp/client.rb:97:in `call'<br>
from /usr/local/lib/ruby/gems/1.8/gems/tmm1-amqp-0.6.4/lib/amqp/client.rb:97:in `unbind'<br> from /usr/local/lib/ruby/gems/1.8/gems/eventmachine-0.12.8/lib/eventmachine.rb:995:in `call'<br> from /usr/local/lib/ruby/gems/1.8/gems/eventmachine-0.12.8/lib/eventmachine.rb:995:in `run_deferred_callbacks'<br>
from /usr/local/lib/ruby/gems/1.8/gems/eventmachine-0.12.8/lib/eventmachine.rb:995:in `times'<br> from /usr/local/lib/ruby/gems/1.8/gems/eventmachine-0.12.8/lib/eventmachine.rb:995:in `run_deferred_callbacks'<br>
from /usr/local/lib/ruby/gems/1.8/gems/eventmachine-0.12.8/lib/eventmachine.rb:242:in `run_machine'<br> from /usr/local/lib/ruby/gems/1.8/gems/eventmachine-0.12.8/lib/eventmachine.rb:242:in `run'<br> from /usr/local/lib/ruby/gems/1.8/gems/tmm1-amqp-0.6.4/lib/amqp.rb:84:in `start'<br>
from test_processor.rb:7</b><br><br>Could it because port 5672 is not accessible from outside? In that case, how do I expose it?<br>I tried iptables like this:<br><b>iptables -A INPUT -p tcp --dport 5672 -j ACCEPT</b><br>
<br>But still no luck. How do I configure rabbitmq to accept requests from external IPs?<br><br>-S<br><br><div class="gmail_quote">2009/9/9 Paul Jones <span dir="ltr"><<a href="mailto:pauljones23@gmail.com">pauljones23@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Sridhar,<br><br>Can you describe how this doesn't work?<br><br>Paul.<br><br><div class="gmail_quote">
<div><div></div><div class="h5">On Wed, Sep 9, 2009 at 8:46 AM, Sridhar Raman <span dir="ltr"><<a href="mailto:sridhar.raman@gmail.com" target="_blank">sridhar.raman@gmail.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="h5">Hi<br><br>This is our current setup that is working in a server:<br>
Listener (that receives the data and publishes it):<br>
<b>module QueueData<br> def receive_data(d)<br> $amq.queue("queue_name").publish(d)<br>
end<br>end<div><br>EM.run {<br> $amq = MQ.new<br></div> EM.start_server "0.0.0.0", 22003, QueueData <br>}</b><br><br>Processor (that subscribes to the queue and processes it):<br><b>EM.run { <br>
amq = MQ.new<br>
amq.queue("queue_name").subscribe { |d|<br> puts d <br> }<br>}</b><br><br>How do I subscribe to this queue from another machine? I tried this:<br><b>AMQP.start(:host => 'hostname', :port => 5672, :logging => true) do<br>
puts "connected ..."<br> mq = MQ.new<br> MQ.queue('queue_name').subscribe{ |msg|<br> puts msg<br> }<br>end</b><br><br>But it doesn't work. Any suggestions?<br>
<br></div></div>_______________________________________________<br>
rabbitmq-discuss mailing list<br>
<a href="mailto:rabbitmq-discuss@lists.rabbitmq.com" target="_blank">rabbitmq-discuss@lists.rabbitmq.com</a><br>
<a href="http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br>
<br></blockquote></div><br>
</blockquote></div><br>