ruby on rails - Consuming messages from RabbitMQ: [amqp] Detected TCP connection failure -
the following rails rake task works on rails development system. after deploying rails production environment fails. rake pform_queue:receive rails_env=production stop ctrl+c waiting application forms ... [amqp] detected tcp connection failure telnet shows rabbitmq listening on default port: telnet localhost 5672 trying 127.0.0.1... connected localhost. escape character '^]'. rtyr fghtryr amqp connection closed foreign host. below code of rake task. desc "wait application forms pform" task :receive => :environment require "amqp" eventmachine.run connection = amqp.connect(:host => 'localhost') channel = amqp::channel.new(connection) queue = channel.queue("pform.applicationforms", :durable => true) puts "stop ctrl+c" puts "waiting application forms ..." queue.subscribe |payload| puts "#{time.now} received message" end