ive been trying to fanout those queues using a ruby consumer very simple it just subscribes to that exchange/queues and it receives the message. now the problem whenever a new message is published. they dont receive the message which means they are not consuming and no consumers are listed. once you rebind the queue with the exchange again and restart the ruby app it starts to consume again. then it goes back to lembo again! sometimes when you restart the ruby app for few times it works. any idea?
code used for the consumer below:
#!/usr/bin/env ruby
# encoding: utf-8
require "rubygems"
require "amqp"
EventMachine.run do
connection = AMQP.connect(:host => '127.0.0.1', :port => 5672, :user => "user",:pass => "pass",:vhost => "/",:ssl => false,:frame_max => 131072 )
puts "Connected to AMQP broker. Running #{AMQP::VERSION} version of the gem..."
channel = AMQP::Channel.new(connection)
exchange = channel.fanout("p_cmds.p1")
channel.queue("p1_queue").bind(exchange).subscribe do |payload|
puts "#{payload} => p1"
end
end