title: How to send multiple batch messages from a list to an SQS queue using Boto3 and Python
body: <p>I have a list of integers (integerList) that I'd like to pass into an SQS queue where each message into the queue is an integer from the list.  </p>
  
  <p>I can do this one message at a time with the <code>send_message()</code> command, and the code for that is below.  </p>
  
  <pre><code>import boto3
  
  sqsResource = boto3.resource('sqs')
  
  def write_sqs(integerList):
      queue = sqsResource.get_queue_by_name(QueueName=NAMEOFQUEUEHERE)
      for i in integerList:
          response = queue.send_message(MessageBody=str(i),
                                        MessageGroupId='TESTING')
  
  </code></pre>
  
  <p>However, I'd like to speed up the function and send the messages in batches.  Currently, AWS SQS allows batching up to 10 messages at a time with the <code>send_messages()</code> command, but I'm not sure how to build the <code>Entries=</code> attribute for the batch send.  I'm breaking down the integerList into smaller lists of 10 using <code>chunks = [integerList[x:x+10] for x in range(0, len(integerList), 10)]</code>, but the next steps are unclear.</p>