title: Azure service bus queue PeekBatch locking?
body: <p>I am using the <code>PeekBatch(&lt;messageCount&gt;)</code> method on the <code>QueueClient</code> (Windows Azure Service Bus package version 2.1.2.0).  </p>
  
  <p>It works fine the first time, and returns my single message that exists in my queue, but subsequent calls return nothing.  After five minutes, the call will then return the message again.  </p>
  
  <p>Five minutes is the maximum lock time on a <code>BrokeredMessage</code>, so I am wondering if <code>PeekBatch</code> is actually locking those messages like it does on a receive, even though peeking should not lock, as far as I know.  </p>
  
  <p>I am trying to build an MVC view to be able to see what is actually sitting in my queue, but this one is getting in the way.  Can anyone provide any guidance on this?</p>
  
  <p><strong>Update</strong>: This only seems to be happening when I cache my <code>QueueClient</code> using a static property.  If I create the <code>QueueClient</code> fresh every time, the <code>PeekBatch</code> works as expected.  I still have no idea why reusing a <code>QueueClient</code> causes this.  <a href="http://msdn.microsoft.com/en-us/library/windowsazure/hh851740.aspx" rel="noreferrer">Microsoft seems to recommend reusing the <code>QueueClient</code> though</a>, instead of recreating it every time, so I am still at a loss here.</p>