def setup_rabbitmq_opts

      rabbit_hosts    = config.fetch("RABBIT_HOST") {"localhost"}
      rabbit_hosts    = rabbit_hosts.split(',')

      # Pick a random host to connect to
      self.host      = rabbit_hosts[Kernel.rand(rabbit_hosts.size)]
      self.amqp_host_list = rabbit_hosts
      self.port      = config["RABBIT_PORT"]

      self.vhost     = config["RABBIT_VHOST"]
      self.user      = config["RABBIT_USER"]
      self.password  = config["RABBIT_PASS"]
      self.heartbeat = config.fetch("RABBIT_HEARTBEAT", 60).to_i
    end
def setup_rabbitmq_opts

      rabbit_hosts    = config.fetch("RABBIT_HOST") {"localhost"}
      rabbit_hosts    = rabbit_hosts.split(',')

      # Pick a random host to connect to
      self.host      = rabbit_hosts[Kernel.rand(rabbit_hosts.size)]
      self.amqp_host_list = rabbit_hosts
      self.port      = config["RABBIT_PORT"]

      self.vhost     = config["RABBIT_VHOST"]
      self.user      = config["RABBIT_USER"]
      self.password  = config["RABBIT_PASS"]
      self.heartbeat = config.fetch("RABBIT_HEARTBEAT", 60).to_i
    end
Public: Setup RabbitMQ's options from a config file. You have the option of
 passing in a comma seperated string of RabbitMQ servers to connect to. When
 using a pool of servers one will be randomly picked for the initial connection.

 config_file - A hash representing a config file

 Examples

   # Single RabbitMQ server
   config = {
     "RABBIT_HOST" => "localhost",
     "RABBIT_VHOST" => "baton",
     "RABBIT_USER" => "baton",
     "RABBIT_PASS" => "password"
     }

   # Use a pool of RabbitMQ servers
   config = {
     "RABBIT_HOST" => "host1,host2,host3",
     "RABBIT_VHOST" => "baton",
     "RABBIT_USER" => "baton",
     "RABBIT_PASS" => "password"
     }

   setup_rabbitmq_opts

 Returns nothing.