Module: Bunnish::Core::Subscribe

Defined in:
lib/bunnish/core/subscribe.rb

Class Method Summary collapse

Class Method Details

.output_subscribe_log(streams, queue, count, log_label) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/bunnish/core/subscribe.rb', line 3

def self.output_subscribe_log(streams, queue, count, log_label)
  message_count = '?'
  consumer_count = '?'
  begin
    message_count = queue.status[:message_count]
    consumer_count = queue.status[:consumer_count]
  rescue Exception=>e
  end

  message = "#{log_label} subscribed #{count} messages from #{queue.name}(#{message_count} messages, #{consumer_count} consumers)"
  Bunnish::Core::Common.output_log(streams, "INFO", message)
end