title: RabbitMQ / AMQP: multiple queues, single consumer
body: <p>I want to create a consumer that process messages from multiple variable number of sources, that are connected or disconnected dynamically.</p>
  
  <p>What I need is that <strong>each consumer prioritize first N messages of each source</strong>. Then to run multiple consumers to improve the speed.</p>
  
  <p>I have been reading docs for <a href="http://www.rabbitmq.com/tutorials/tutorial-two-javascript.html" rel="nofollow noreferrer">Work queues</a>, <a href="http://www.rabbitmq.com/tutorials/tutorial-four-javascript.html" rel="nofollow noreferrer">Routing</a> and <a href="http://www.rabbitmq.com/tutorials/tutorial-five-javascript.html" rel="nofollow noreferrer">Topics</a>, and a lot of other docs without identifying how to implement this. Also I made some tests without luck.</p>
  
  <p>Can someone point me how to do it or where to read about it?</p>
  
  <p>--EDIT--</p>
  
  <p>QueueA-----A3--A2--A1-┐</p>
  
  <p>QueueB-----B3--B2--B1-┼------ Consumer </p>
  
  <p>QueueC-----C3--C2--C1-┘</p>
  
  <p>The desired effect is that each consumer gets first messages of each queue. For example: A1, B1, C1, A2, B2, C2, A3, B3, C3, and so on. If a new queue is created (QueueD), the consumer would start receiving messages from it in the same fashion.</p>
  
  <p>Thanks in advance</p>