class EventQ::RabbitMq::QueueClient

Constants

GUEST

Public Class Methods

new(options = {}) click to toggle source
# File lib/eventq/eventq_rabbitmq/rabbitmq_queue_client.rb, line 7
def initialize(options = {})

  if options[:endpoint] == nil
    raise ':endpoint must be specified.'.freeze
  end

  @endpoint = options[:endpoint]

  @port = Integer(options[:port] || 5672)

  @user = options[:user] || GUEST

  @password = options[:password] || GUEST

  @ssl = options[:ssl] == true || false

end

Public Instance Methods

connection_options() click to toggle source
# File lib/eventq/eventq_rabbitmq/rabbitmq_queue_client.rb, line 25
def connection_options
  {
      :host => @endpoint,
      :port => @port,
      :user => @user,
      :pass => @password,
      :ssl => @ssl,
      :read_timeout => 4,
      :heartbeat => 8,
      :continuation_timeout => 5000,
      :automatically_recover => true,
      :network_recovery_interval => 1,
      :recover_from_connection_close => true
  }
end
get_connection() click to toggle source
# File lib/eventq/eventq_rabbitmq/rabbitmq_queue_client.rb, line 41
def get_connection
  conn = Bunny.new(connection_options)
  conn.start
  return conn
end