 -        for sp_key, value in server_params.iteritems():
 -            p_key = server_params_to_kombu_params.get(sp_key, sp_key)
 -            params[p_key] = value
--
--        params.setdefault('hostname', FLAGS.rabbit_host)
--        params.setdefault('port', FLAGS.rabbit_port)
--        params.setdefault('userid', FLAGS.rabbit_userid)
--        params.setdefault('password', FLAGS.rabbit_password)
--        params.setdefault('virtual_host', FLAGS.rabbit_virtual_host)
--
++        ssl_params = self._fetch_ssl_params()
++        params_list = []
++        for adr in self.conf.rabbit_hosts:
++            hostname, port = network_utils.parse_host_port(
++                adr, default_port=self.conf.rabbit_port)
+ 
+-        params.setdefault('hostname', self.conf.rabbit_host)
+-        params.setdefault('port', self.conf.rabbit_port)
+-        params.setdefault('userid', self.conf.rabbit_userid)
+-        params.setdefault('password', self.conf.rabbit_password)
+-        params.setdefault('virtual_host', self.conf.rabbit_virtual_host)
++            params = {}
+ 
 -        self.params = params
--
--        if FLAGS.fake_rabbit:
++            for sp_key, value in server_params.iteritems():
++                p_key = server_params_to_kombu_params.get(sp_key, sp_key)
++                params[p_key] = value
+ 
+-        if self.conf.fake_rabbit:
 -            self.params['transport'] = 'memory'
 -            self.memory_transport = True
 -        else:
 -            self.memory_transport = False
-+        params_list = []
-+        for adr in FLAGS.rabbit_addresses:
-+            hostname, port = adr.split(':')
-+            params = {}
-+            for sp_key, value in server_params.iteritems():
-+                p_key = server_params_to_kombu_params.get(sp_key, sp_key)
-+                params[p_key] = value
 +            params.setdefault('hostname', hostname)
-+            params.setdefault('port', int(port))
-+            params.setdefault('userid', FLAGS.rabbit_userid)
-+            params.setdefault('password', FLAGS.rabbit_password)
-+            params.setdefault('virtual_host', FLAGS.rabbit_virtual_host)
-+            if FLAGS.fake_rabbit:
++            params.setdefault('port', port)
++            params.setdefault('userid', self.conf.rabbit_userid)
++            params.setdefault('password', self.conf.rabbit_password)
++            params.setdefault('virtual_host', self.conf.rabbit_virtual_host)
++
++            if self.conf.fake_rabbit:
 +                params['transport'] = 'memory'
 +            else:
 +                params['transport'] = 'pyamqp'
-+            if FLAGS.rabbit_use_ssl:
-+                params['ssl'] = self._fetch_ssl_params()
-+
++            if self.conf.rabbit_use_ssl:
++                params['ssl'] = ssl_params
+ 
+-        if self.conf.rabbit_use_ssl:
+-            self.params['ssl'] = self._fetch_ssl_params()
 +            params_list.append(params)
 +
 +        self.params_list = params_list
- 
--        if FLAGS.rabbit_use_ssl:
--            self.params['ssl'] = self._fetch_ssl_params()
-+        self.memory_transport = FLAGS.fake_rabbit
++
++        self.memory_transport = self.conf.fake_rabbit
  
          self.connection = None
          self.reconnect()
-@@ -398,14 +400,14 @@
+@@ -422,23 +461,24 @@ class Connection(object):
              # Return the extended behavior
              return ssl_params
  

diff -r -N -u3 a/flags.py b/flags.py
--- a/flags.py 2012-08-02 01:34:23.725950885 +0000
+++ b/flags.py 2012-08-02 01:34:10.914851304 +0000
@@ -195,6 +195,9 @@
     cfg.IntOpt('rabbit_port',
                default=5672,
                help='the RabbitMQ port'),
+    cfg.ListOpt('rabbit_addresses',
+               default=['$rabbit_host:$rabbit_port'],
+               help='RabbitMQ HA cluster host:port pairs'),
     cfg.BoolOpt('rabbit_use_ssl',
                 default=False,
                 help='connect over SSL for RabbitMQ'),
diff -r -N -u3 a/rpc/impl_kombu.py b/rpc/impl_kombu.py
--- a/rpc/impl_kombu.py    2012-08-01 23:18:25.832654796 +0000
+++ b/rpc/impl_kombu.py    2012-08-01 23:20:56.941282534 +0000
@@ -77,6 +77,7 @@
         """Re-declare the queue after a rabbit reconnect"""
         self.channel = channel
         self.kwargs['channel'] = channel
+        self.kwargs['queue_arguments'] = {'x-ha-policy': 'all'}
         self.queue = kombu.entity.Queue(**self.kwargs)
         self.queue.declare()
 
@@ -348,27 +349,30 @@
         # Keys to translate from server_params to kombu params
         server_params_to_kombu_params = {'username': 'userid'}
 

         """
         if self.connection:
             LOG.info(_("Reconnecting to AMQP server on "
-                     "%(hostname)s:%(port)d") % self.params)
+                     "%(hostname)s:%(port)d") % params)
             try:
                 self.connection.close()
-            except self.connection_errors:
+            except (self.connection_errors, self.channel_errors):
                 pass
             # Setting this in case the next statement fails, though
             # it shouldn't be doing any network operations, yet.
             self.connection = None
-        self.connection = kombu.connection.BrokerConnection(**self.params)
+        self.connection = kombu.connection.BrokerConnection(**params)
         self.connection_errors = self.connection.connection_errors
+        self.channel_errors = self.connection.channel_errors
         if self.memory_transport:
             # Kludge to speed up tests.
             self.connection.transport.polling_interval = 0.0
@@ -450,8 +490,8 @@ class Connection(object):
             self.channel._new_queue('ae.undeliver')
         for consumer in self.consumers:
             consumer.reconnect(self.channel)
-        LOG.info(_('Connected to AMQP server on %(hostname)s:%(port)d'),
-                 self.params)
+        LOG.info(_('Connected to AMQP server on %(hostname)s:%(port)d') %
+                 params)
 
     def reconnect(self):
         """Handles reconnecting and re-establishing queues.
@@ -464,11 +504,12 @@ class Connection(object):
 
         attempt = 0
         while True:
