Closed Andrey-Anatolyevich closed 5 years ago
Don't get frustrated @Andrey-Anatolyevich.
You can find message counts under ManagementClient.GetQueueRuntimeInfoAsync
and similar. Cheers.
@SeanFeldman, Thank you for fast response. Also, could you advice a code snippet by a chance? This is what I see in suggested class & method result: It doesn't look like the result has any details on queue size.
I feel like I'm missing something big and obvious whereas working with WindowsAzure.ServiceBus was very smooth and intuitive.
What you get back is a Task
(promise), not the result. Being an asynchronous method (notice Async()
at the end), you have to await for the call to get the results. Hope that helps.
@SeanFeldman, Thank you. I got the counts.
Snippet for those, who might struggle as well:
var mgmtClient = new ManagementClient(connectionString);
var runtimeInfo = mgmtClient.GetQueueRuntimeInfoAsync("[QUEUE-NAME]").GetAwaiter().GetResult();
var activeCount = runtimeInfo.MessageCountDetails.ActiveMessageCount;
var deadletterCount = runtimeInfo.MessageCountDetails.DeadLetterMessageCount;
var transferCount = runtimeInfo.MessageCountDetails.TransferMessageCount;
Actual Behavior
Expected Behavior
Versions
Comment: It is so frustrating to see such basic functionality cut for "So much loved by Microsoft" NetStandard compatible library as opposed to WindowsAzure.ServiceBus, which is for WINDOWS only! Guys, it pisses off and pushes faar-far away from any of your products.