title: RabbitMQ bulk consuming messages solution
body: <p>I'm using RabbitMQ as a queue of different messages. When I consume this messages with <strong>two different</strong> consumers from <strong>one queue</strong>, I process them and insert processing results to a DB:</p>
  <pre><code>def consumer_callback(self, channel, delivery_tag, properties, message):
      result = make_some_processing(message)
      insert_to_db(result)
      channel.basic_ack(delivery_tag)
  </code></pre>
  <p>I want to bulk consume messages from queue, that will reduce DB load. Since RabbitMQ does not support bulk reading messages by consumers I'm going to do smth like this:</p>
  <pre><code>some_messages_list = []
  def consumer_callback(self, channel, delivery_tag, properties, message):
      some_messages_list.append({delivery_tag: message})
      if len(some_messages_list) &gt; 1000:
          results_list = make_some_processing_bulk(some_messages_list)
          insert_to_db_bulk(results_list)
          
          for tag in some_messages_list:
              channel.basic_ack(tag)
          some_messages_list.clear()
  </code></pre>
  <ol>
  <li>Messages are in queue before they all fully processed</li>
  <li>If consumer falls or disconnects - messages stays safe</li>
  </ol>
  <p>What do you think about that solution?
  If it's okay, how can I get all unacknoleged messages anew, if consumer falls?</p>