title: RabbitMQ configuration for multiple queues
body: <p>Apparently I had configured a single queue for receiving user's posts in my application. Below is the configuration.</p>
  
  <pre><code>&lt;!-- Creates a queue for consumers to retrieve messages --&gt;
  &lt;rabbit:queue name="UserPostpublishQueue" durable="true"&gt;
  &lt;/rabbit:queue&gt;
  
  &lt;!-- queue for sending notifications to users --&gt;
  &lt;rabbit:queue name="notificationQueue" durable="true"/&gt;
  
  
  &lt;!-- Fanout exchange for a pubsub bound to UserPostpublishQueue --&gt;
  &lt;fanout-exchange name="broadcastEvents" durable="true" xmlns="http://www.springframework.org/schema/rabbit"&gt;
      &lt;bindings&gt;
          &lt;binding queue="UserPostpublishQueue"/&gt;
      &lt;/bindings&gt;
  &lt;/fanout-exchange&gt;
  
  &lt;rabbit:template id="amqpTemplate" connection-factory="connectionFactory" retry-template="retryTemplate" 
  exchange="broadcastEvents" channel-transacted="true"/&gt;
  </code></pre>
  
  <p>In the code I just autowired the AMQP template </p>
  
  <pre><code>@Autowired
      AmqpTemplate amqpTemplate;
      amqpTemplate.convertAndSend(post);
  </code></pre>
  
  <p>Now I have to introduce another notification queue. I am not sure how to do that. Do I bind the queue with the same fanout exchange, on doing that the exchange is pushing the user's post into the notification queue. </p>
  
  <p>Or do I create another fanout exchange &amp; then bind the notification queue with that exchange but then how do I register this new exchange with the amqp template?</p>
  
  <p>Or do I create a direct exchange for both user post &amp; notification queue?</p>
  
  <p>I am not sure. Any help would be appreciated.</p>