code: public void bulkAction(ArrayDeque<MessageManager> messageQueue, String queueUrl) throws JMSException {
          List<String> receiptHandles = new ArrayList<String>();
          while (!messageQueue.isEmpty()) {
              receiptHandles.add(((SQSMessage) (messageQueue.pollFirst().getMessage())).getReceiptHandle());
  
              // If there is more than 10 stop can call action
              if (receiptHandles.size() == SQSMessagingClientConstants.MAX_BATCH) {
                  action(queueUrl, receiptHandles);
                  receiptHandles.clear();
              }
          }
          action(queueUrl, receiptHandles);
      }
docs: Bulk action for negative acknowledge on the list of messages of a
  specific queue.
  
  @param messageQueue
  Container for the list of message managers.
  @param queueUrl
  The queueUrl of the messages, which they received from.
  @throws JMSException
  If <code>action</code> throws.