title: How to get Spring RabbitMQ to create a new Queue?
body: <p>In my (limited) experience with rabbit-mq, if you create a new listener for a queue that doesn't exist yet, the queue is automatically created. I'm trying to use the Spring AMQP project with rabbit-mq to set up a listener, and I'm getting an error instead. This is my xml config:</p>
  
  <pre><code>&lt;rabbit:connection-factory id="rabbitConnectionFactory" host="172.16.45.1" username="test" password="password" /&gt;
  
  &lt;rabbit:listener-container connection-factory="rabbitConnectionFactory"  &gt;
      &lt;rabbit:listener ref="testQueueListener" queue-names="test" /&gt;
  &lt;/rabbit:listener-container&gt;
  
  &lt;bean id="testQueueListener" class="com.levelsbeyond.rabbit.TestQueueListener"&gt; 
  &lt;/bean&gt;
  </code></pre>
  
  <p>I get this in my RabbitMq logs:</p>
  
  <pre><code>=ERROR REPORT==== 3-May-2013::23:17:24 ===
  connection &lt;0.1652.0&gt;, channel 1 - soft error:
  {amqp_error,not_found,"no queue 'test' in vhost '/'",'queue.declare'}
  </code></pre>
  
  <p>And a similar error from AMQP:</p>
  
  <pre><code>2013-05-03 23:17:24,059 ERROR [org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer] (SimpleAsyncTaskExecutor-1) - Consumer received fatal exception on startup
  org.springframework.amqp.rabbit.listener.FatalListenerStartupException: Cannot prepare queue for listener. Either the queue doesn't exist or the broker will not allow us to use it.
  </code></pre>
  
  <p>It would seem from the stack trace that the queue is getting created in a "passive" mode- Can anyone point out how I would create the queue not using the passive mode so I don't see this error? Or am I missing something else?</p>