code: protected List<Message> getMessages(int prefetchBatchSize) throws InterruptedException {
  
          assert prefetchBatchSize > 0;
  
          ReceiveMessageRequest receiveMessageRequest = new ReceiveMessageRequest(queueUrl)
                                                                .withMaxNumberOfMessages(prefetchBatchSize)
                                                                .withAttributeNames(ALL)
                                                                .withMessageAttributeNames(ALL)
                                                                .withWaitTimeSeconds(WAIT_TIME_SECONDS);
          //if the receive request is for FIFO queue, provide a unique receive request attempt it, so that
          //failed calls retried by SDK will claim the same messages
          if (sqsDestination.isFifo()) {
              receiveMessageRequest.withReceiveRequestAttemptId(UUID.randomUUID().toString());
          }
          List<Message> messages = null;
          try {
              ReceiveMessageResult receivedMessageResult = amazonSQSClient.receiveMessage(receiveMessageRequest);
              messages = receivedMessageResult.getMessages();
              retriesAttempted = 0;
          } catch (JMSException e) {
              LOG.warn("Encountered exception during receive in ConsumerPrefetch thread", e);
              try {
                  sleep(backoffStrategy.delayBeforeNextRetry(retriesAttempted++));
              } catch (InterruptedException ex) {
                  LOG.warn("Interrupted while retrying on receive", ex);
                  throw ex;
              }
          }
          return messages;
      }
docs: Call <code>receiveMessage</code> with long-poll wait time of 20 seconds
  with available prefetch batch size and potential re-tries.