[rabbitmq-discuss] RabbitMQ HA

jrob roberts.john at gmail.com
Wed Jan 18 17:16:22 GMT 2012


Yup, that was it exactly.  I just had the diff up, so here are the two 
major changes I had to make:

-    channel.queue( @queue, :durable => true ).subscribe(:ack=>true) do 
|header,message|
+    channel.queue( @queue, :durable => true, :arguments => {'x-ha-policy' 
=> 'all'} ).subscribe(:ack=>true) do |header,message|

   def self.get_channel(host)
     connection = AMQP.connect( :host=>host )
+    connection.on_connection_interruption do |conn, settings|
+      conn.reconnect(false,1)
+    end
+
     channel    = AMQP::Channel.new( connection )
+    channel.auto_recovery = true
+
+    channel
   end

As I said, this hasn't gone into production yet, but it seems to be doing 
well in our staging environment.  I don't think our message rate is high 
enough to really exercise this setup in staging, so I can't really comment 
on performance yet.  (We're holding off moving this into production as we 
are trying to provide high availability for our applications and services 
across the board, which in some cases means we will be using one VM for 
multiple services.  Since the other services aren't ready to go yet, we 
haven't pushed this up.)

- jrob

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20120118/63fd7f23/attachment.htm>


More information about the rabbitmq-discuss mailing list