title: Amazon SQS - FIFO Queue message request, inconsistent receives
body: <p>I have a FIFO SQS queue, with visibility time of 30 seconds.
  The requirement is to read messages as Quickly as possible and clear the queue.</p>
  
  <p>I have code in JAVA in a fashion shown below ( <em>this is just a representation of idea only, not complete code</em> ):</p>
  
  <pre><code>//keep getting messages from FIFO and process them ASAP
  while(true)
  {
       List&lt;Message&gt; messages = 
       sqsclient.receiveMessage(receiveMessageRequest).getMessages();
      //my logic/code here to process these messages and delete them ASAP
  }
  </code></pre>
  
  <p>In the while loop as soon as the messages are received, they are processed and removed from the queue.
  But, <strong>many times</strong> the receiveMessageRequest does not give me messages (returns zero messages).</p>
  
  <p>Also, the messages limitation is only 10 at a time during receive from SQS, which is already an issue, but due to these zero receives, the queues are piling up.</p>
  
  <p>I have no clue why this is happening. The documentation exactly is not clear on this part (or Am I missing in terms of the configuration of the queue?)</p>
  
  <p>Please help!</p>
  
  <p><strong>Note: 
  1. My FIFO Queue always has messages in this scenario, so there is no case of Queue having zero messages and receive request returning zero</strong></p>
  
  <p><strong>2. The processing and delete times are also Less than the visibility timeout.</strong></p>
  
  <p>Thanks.</p>
  
  <p><strong>Update:</strong>
  <strong>I have started running multiple consumers for processing the FIFO queue. Clearly, one consumer is not coping up with the inflow of messages. I shall update in few days how multiple consumers are performing. Thanks</strong></p>