Quantcast
Channel: Service Bus forum
Viewing all articles
Browse latest Browse all 1916

QueueClient.Peek returns future/scheduled message instead of next active message

$
0
0

I have a Service Bus Queue with two messages in it:

  • One enqueued 10 minutes ago with a ScheduledEnqueueTimeUtc set to 30 minutes in the future
  • One enqueued 5 minutes ago (for immediate processing)

When I call QueueClient.PeekAsync, I'm getting the first message (the first enqueued message) instead of the second (the next message that will be processed).

Is this the expected behavior of Peek? If so, is there any way to inspect (without removing from the queue) the next message that will be processed?

My scenario is that I'm trying to calculate our queue latency and the queue contains a mix of scheduled/non-scheduled messages. Currently, I'm working around the behavior noted above by calling PeekBatchAsync to retrieve several messages and then I'm sorting them by when I expect the messages to "become visible" (i.e. eligible for processing).

I'm looking for a fully supported solution (or any mistakes in my observations/analysis/logic above).

Thanks!


Viewing all articles
Browse latest Browse all 1916

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>