title: Android - Getting messages from AWS SQS
body: <p>I have function which returns messages from AWS SQS:</p>
  
  <pre><code>  public List&lt;Message&gt; getMessagesFromQueue(String queueUrl){
         ReceiveMessageRequest receiveMessageRequest = new ReceiveMessageRequest(queueUrl);
         List&lt;Message&gt; messages = sqs.receiveMessage(receiveMessageRequest).getMessages();
         return messages;
      }
  </code></pre>
  
  <p>The problem is that it returns different number of messages each time, never all 4 which I have in the queue.</p>