title: RabbitMQ: Connecting & publishing to an existing queue in Ruby
body: <p>I have two process types on Heroku: a web dyno in Ruby and a worker in Node.js. I'm using the RabbitMQ addon (currently beta) to pass a message from Ruby to Node. Node connects and consumes correctly, and <strong>Ruby connects and publishes correctly as long as it is the first to connect / create the queue</strong>. </p>
  
  <p>Apparently, <a href="https://github.com/famoseagle/carrot/issues/2" rel="nofollow">Carrot throws some funny errors when you try to create a queue that already exists</a>, which is how I discovered that the reason for not being able to get my message across (I could have sworn it worked when I tested last night) was that I started my Node process before my Ruby. </p>
  
  <p>Since I'm on Heroku, I'm going to have more than one of each Ruby and Node threads working concurrently, and they each need to support being the first to start a queue and connect into an existing queue, without issue. </p>
  
  <p><strong>Which brings me to my question:</strong> </p>
  
  <p>How do I connect to an existing RabbitMQ queue, using Ruby, for the purpose of publishing messages to consumers which are already connected and waiting to receive messages? </p>