def connect(address, reconnect_interval)
      begin
        logger.info("[setup] Connecting to broker #{@identity}, alias #{@alias}")
        @status = :connecting
        @connection = AMQP.connect(:user               => @options[:user],
                                   :pass               => @options[:pass],
                                   :vhost              => @options[:vhost],
                                   :host               => address[:host],
                                   :port               => address[:port],
                                   :ssl                => @options[:ssl],
                                   :identity           => @identity,
                                   :insist             => @options[:insist] || false,
                                   :heartbeat          => @options[:heartbeat],
                                   :reconnect_delay    => lambda { rand(reconnect_interval) },
                                   :reconnect_interval => reconnect_interval)
        @channel = MQ.new(@connection)
        @channel.__send__(:connection).connection_status { |status| update_status(status) }
        @channel.prefetch(@options[:prefetch]) if @options[:prefetch]
        @channel.return_message { |header, message| handle_return(header, message) }
      rescue StandardError => e
        @status = :failed
        @failure_stats.update
        logger.exception("Failed connecting to broker #{@alias}", e, :trace)
        @exception_stats.track("connect", e)
        @connection.close if @connection
      end
    end
def connect(address, reconnect_interval)
      begin
        logger.info("[setup] Connecting to broker #{@identity}, alias #{@alias}")
        @status = :connecting
        @connection = AMQP.connect(:user               => @options[:user],
                                   :pass               => @options[:pass],
                                   :vhost              => @options[:vhost],
                                   :host               => address[:host],
                                   :port               => address[:port],
                                   :ssl                => @options[:ssl],
                                   :identity           => @identity,
                                   :insist             => @options[:insist] || false,
                                   :heartbeat          => @options[:heartbeat],
                                   :reconnect_delay    => lambda { rand(reconnect_interval) },
                                   :reconnect_interval => reconnect_interval)
        @channel = MQ.new(@connection)
        @channel.__send__(:connection).connection_status { |status| update_status(status) }
        @channel.prefetch(@options[:prefetch]) if @options[:prefetch]
        @channel.return_message { |header, message| handle_return(header, message) }
      rescue StandardError => e
        @status = :failed
        @failure_stats.update
        logger.exception("Failed connecting to broker #{@alias}", e, :trace)
        @exception_stats.track("connect", e)
        @connection.close if @connection
      end
    end
Connect to broker and register for status updates
 Also set prefetch value if specified and setup for message returns

 === Parameters
 address(Hash):: Broker address
   :host(String:: IP host name or address
   :port(Integer):: TCP port number for individual broker
   :index(String):: Unique index for broker within given set for use in forming alias
 reconnect_interval(Integer):: Number of seconds between reconnect attempts

 === Return
 true:: Always return true