0

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
Waheed
  • 608
  • 1
  • 5
  • 20
  • Nothing jumps out at me. Might help to see the publish side code too. Also, I've had better luck with the bunny gem than any of the other rabbitmq gems for ruby. – Some Guy Feb 26 '14 at 02:26
  • Thanks anyway Some Guy. hopefully someone is willing to give it a few seconds of their time. – Waheed Mar 05 '14 at 18:25
  • It would be nice to have some example output and also the code from your producer. From your description it looks as if your consumer is not `ack`ing the messages that it receives. One way you can confirm this is by running ```rabbitmqctl list_queues``` to see if one queue is constantly growing despite your consumer receiving messages. I'm not familiar with the way that is done in ruby. – Marc Oct 28 '16 at 16:51

0 Answers0