title: RabbitMQ change queue parameters on a production system
body: <p>I'm using RabbitMQ as a message queue in a service-oriented architecture, where many separate web services publish messages bound for RabbitMQ queues. Those queues are in turn subscribed to by various consumers, which perform background work; a pretty vanilla use-case for RabbitMQ. </p>
  
  <p>Now I'd like to change some of the queue parameters (specifically, I'd like to bind queues to a new dead-letter exchange with a certain routing key). My problem is that making this change in place on a production system is problematic for a couple reasons.</p>
  
  <p>Whats the best way for me to transition to these new queues without losing messages in a production system?</p>
  
  <p>I've considered everything from versioning queue names to making a new vhost with the new settings to doing all the changes in place.</p>
  
  <p>Here are some of the problems I'm facing:</p>
  
  <ol>
  <li><p>Because RabbitMQ queues are idempotent, the disparate web services have been declaring the queues before publishing to them (in case they don't already exist).  Once you change the queue parameters (but maintain the same routing key), the queue declare fails and RabbitMQ closes the channel.</p></li>
  <li><p>I'd like to not lose messages when changing a queue (here I'm planning on subscribing an exclusive consumer that saves the messages and then republishes to the new queue).</p></li>
  <li><p>General coordination between disparate publishers and the consumer base (or, even better, a way to avoid needing to coordinate them). </p></li>
  </ol>