title: RabbitMQ: multiple messages and single consumer
body: <p>I have a problem with RabbitMQ consumer. Actually i have a single consumer geting messages from three queues. The problem is that i need to get a multiple messages from each of them, but my consumer gets only one per queue and ends getting. I would be grateful if someone could help me solve this problem.</p>
  
  <p>Consumer code below</p>
  
  <pre><code>        for (int i = 0; i &lt; queueNames.size(); i++) {
  
          Channel channel = connection.createChannel();
          QueueingConsumer consumer = new QueueingConsumer(channel);
          channel.basicConsume(queueNames.get(i).toString(), true, consumer_tag, consumer);
  
          flag = true;
          while (flag) {
  
              QueueingConsumer.Delivery delivery = consumer.nextDelivery();
              String routingKey = delivery.getEnvelope().getRoutingKey();
              System.out.println(routingKey);
              String message = new String(delivery.getBody(), "UTF-8");
  
                  flag = false;
          }
      }
  </code></pre>
  
  <p>where queueNames is a list containing names of my queues (in number of 3).</p>