Describe the bug
Method getSubscriptionRuntimeProperties of class ServiceBusAdministrationClient does not give correct message counts in properties.
More precisely, the internal method getMessageCountDetails parses the ServiceBus response expecting count properties to have prefix d2p1: while it is receiving those properties with prefix d3p1: withing response.parsedBody.CountDetails.
To Reproduce
Steps to reproduce the behavior:
const client = new ServiceBusAdministrationClient(...);
const properties = await client.getSubscriptionRuntimeProperties('topic-name', 'sub-name');
console.log(properties.activeMessageCount); // prints "0"
Expected behavior
...
console.log(properties.activeMessageCount); // should print "3"
Additional context
Note that response.parsedBody.CountDetails within the package code has the following value when I call getSubscriptionRuntimeProperties:
{
$: {
"xmlns:d3p1": "http://schemas.microsoft.com/netservices/2011/06/servicebus",
},
"d3p1:ActiveMessageCount": "3",
"d3p1:DeadLetterMessageCount": "0",
"d3p1:ScheduledMessageCount": "0",
"d3p1:TransferMessageCount": "0",
"d3p1:TransferDeadLetterMessageCount": "0",
}
Thanks for all the details, @laudibert.
I am able to repro the issue. Looks like the tag in the service response has changed.
Will be coming up with a fix soon.
@HarshaNalluru cheers!
@laudibert
https://github.com/Azure/azure-sdk-for-js/pull/13229 should fix the bug. This fix will be part of the next patch release.
In the meantime, I'll share the dev version for you to try out the fix once the PR is merged.
Thank you! Looking forward for the release then.
Hey @HarshaNalluru, do you know when it will possible to get this fix merged?
Hey @laudibert, thanks for waiting.
I'll try my best to get it reviewed and merged tomorrow and share a dev version with you.
@laudibert The fix has been checked in, it would be included in the 7.0.3 version, which we aim to release by the end of this week.
If you'd like to try out the dev version of the package which includes the fix, please install with npm install @azure/service-bus@dev
(New dev versions are released once a day.)
Current dev version - https://www.npmjs.com/package/@azure/service-bus/v/7.0.3-alpha.20210119.2
Feel free to open new issues in this repository in case you run into problems.
Thank you :)