[Service Bus] getSubscriptionRuntimeProperties does not give correct message counts
See original GitHub issue- Package Name: @azure/service-bus
- Package Version: 7.0.2
- nodejs
- version: v12.10.0
- typescript
- version: 4.0.5
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:
- Create ServiceBus topic
- Create subscription on this topic
- Send 3 messages on this to topic.
- Start node program using package with something like:
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",
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
ServiceBusAdministrationClient class - Microsoft Learn
Returns an object representing the Subscription and its properties. If you want to get the Subscription runtime info like message count details, use ......
Read more >Getting count of total messages in a subscription client that is ...
I am looking for node.js code, many places on internet they have given in JAVA or c# but for count I cannot find...
Read more >ServiceBusManagementClient | @azure/service-bus - NET
Returns an object representing the Subscription runtime info like message count details. throws. RestError with code UnauthorizedRequestError when given request ...
Read more >Microsoft Azure Service Bus operation
When it reaches this maximum, or the Maximum Message Count, the operation stops returning messages. If you do not provide a value, the...
Read more >Azure Service Bus and its Complete Overview | Serverless360
With exceptional ingress rates, it can take on many incoming messages storing those internally offering no queue semantics. While it might sound like...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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.
Hey @laudibert, thanks for waiting. I’ll try my best to get it reviewed and merged tomorrow and share a dev version with you.