code: public List<Message> pollQueue() {
          boolean success = false;
          ProgressStatus pollQueueStatus = new ProgressStatus(ProgressState.pollQueue, new BasicPollQueueInfo(0, success));
          final Object reportObject = progressReporter.reportStart(pollQueueStatus);
  
          ReceiveMessageRequest request = new ReceiveMessageRequest().withAttributeNames(ALL_ATTRIBUTES);
          request.setQueueUrl(config.getSqsUrl());
          request.setVisibilityTimeout(config.getVisibilityTimeout());
          request.setMaxNumberOfMessages(DEFAULT_SQS_MESSAGE_SIZE_LIMIT);
          request.setWaitTimeSeconds(DEFAULT_WAIT_TIME_SECONDS);
  
          List<Message> sqsMessages = new ArrayList<Message>();
          try {
  
              ReceiveMessageResult result = sqsClient.receiveMessage(request);
              sqsMessages = result.getMessages();
              logger.info("Polled " + sqsMessages.size() + " sqs messages from " + config.getSqsUrl());
  
              success = true;
          } catch (AmazonServiceException e) {
              LibraryUtils.handleException(exceptionHandler, pollQueueStatus, e, "Failed to poll sqs message.");
  
          } finally {
              LibraryUtils.endToProcess(progressReporter, success, pollQueueStatus, reportObject);
          }
          return sqsMessages;
  
      }
docs: Poll SQS queue for incoming messages, filter them, and return a list of SQS Messages.
  
  @return a list of SQS messages.