Service Bus for Windows Server / SubscriptionDescription MessageCountDetails properties are all zeros! (0's)

StackOverflow https://stackoverflow.com/questions/17432037

  •  02-06-2022
  •  | 
  •  

Question

I'm writing a 'Service Bus Monitor' [Windows] service so that we can keep an eye on our topic/subscription(s) and have run into an interesting issue. (And of course by "interesting" I mean "super frick'en annoying.")

For each of my topic/subscription pairs, I create a SubscriptionDescription so that I can get the MessageCount. This works just fine.

var subscriptionDescription = namespaceManager.GetSubscription(
    busTargetModel.Topic, busTargetModel.Subscription);

var messageCountThisSubscription = subscriptionDescription.MessageCount;

However, in one particular case messageCountThisSubscription == 51 and I happen to know that all 51 are actually sitting in the dead letter box/queue/whatever, but, when I try to get the MessageCountDetails...

// I actually make this call BEFORE the MessageCount call above.
// (In case that matters somehow)
var messageCountDetails = subscriptionDescription.MessageCountDetails;

...all 5 of it's properties (ActiveMessageCount, DeadLetterMessageCount, ScheduledMessageCount, TransferDeadLetterMessageCount and TransferMessageCount) have a value of 0 (Zero!)

I cannot for the life of me imagine what I could be doing wrong here; seems pretty straight forward, yet.. ZEROS.

Thoughts, insights, ANY help appreciated!

(This is for Service Bus for Windows Server but I don't see any tags for this except for all the Azure stuff, and from what I've read, they are NOT created equal.. at least not yet, so hoping I got the tags right.)

Was it helpful?

Solution

Scott, Service Bus 1.0 for Windows Server does not have support for message count details. That feature was implemented after the bits locked down so these properties are not returning the expected values. We have a symmetric (single) client library for both Server and Service offering of Service Bus so you see them available but the values are only populated when targeting the Service or the recently released preview for Service Bus 1.1 for Windows Server. You can install this from WebPI, more details are here: http://msdn.microsoft.com/en-us/library/windowsazure/dn282144(v=azure.10).aspx

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top