title: Azure Queue Storage - Mark messages as visible immediately after calling CloudQueue.GetMessages()
body: <p><strong>Problem:</strong> </p>
  
  <p>I am reading messages from a Azure Storage Queue and then inserting them into a Storage Table using a Worker Role.  </p>
  
  <p>I want to read in messages but only process them if there are at least 100 (this is to optimize the Storage Table batch insert which is occurring).  If there are less than 100 messages, then I want to cancel the message processing and make them immediately visible on the queue again for the next queue read.</p>
  
  <p><strong>Question:</strong> </p>
  
  <p>Is it possible to mark a message which has just been read by <code>CloudQueue.GetMessages(...)</code> as visible without having to wait for the timeout to expire?</p>
  
  <p><strong>Code:</strong> (in WorkerRole.cs)</p>
  
  <pre><code>public override void Run()
  {
      while (true)
      {
          var messages = queue.GetMessages(100);
  
          if (messages.Count() &gt;= 100)
          {
              // This will process, insert into a table, and delete from the queue
              ProcessMessages(messages);
          }
          else
          {
              //!!! MARK MESSAGES AS VISIBLE ON THE QUEUE
              System.Threading.Thread.Sleep(1000);
          }
      }
  }
  </code></pre>
  
  <p>Thanks</p>