Skip to content

[Service Bus] Add topic sqlFilterCount and correlationFilterCount runtime properties - #39500

Merged
Eldert Grootenboer (EldertGrootenboer) merged 7 commits into
mainfrom
feature/servicebus-topic-filter-counts-37720586
Aug 14, 2026
Merged

Eldert Grootenboer (EldertGrootenboer) merged 7 commits into
mainfrom
feature/servicebus-topic-filter-counts-37720586

Conversation

@EldertGrootenboer

Copy link
Copy Markdown
Member

Description

Adds two read-only runtime properties to TopicRuntimeProperties:

  • sqlFilterCount — the total number of SQL filters across all of a topic's subscriptions.
  • correlationFilterCount — the total number of correlation filters across all of a topic's subscriptions.

These counts are served by Service Bus management API version 2024-05, so CURRENT_API_VERSION is updated to 2024-05 and the public serviceVersion option is widened accordingly. When the service does not report the counts (an older api-version or a region that has not yet deployed the feature), the properties are undefined, consistent with the existing subscriptionCount.

This is the JS member of a coordinated cross-language effort. The reference implementation is the merged .NET PR Azure/azure-sdk-for-net#61559; sibling PRs exist for Java, Go, and Python.

Implementation notes

  • Deserializes the SqlFilterCount/CorrelationFilterCount ATOM elements via getIntegerOrUndefined, mirroring subscriptionCount.
  • Bumps CURRENT_API_VERSION to 2024-05 and widens the ServiceBusAtomAPIVersion union and the public serviceVersion option type.
  • Regenerates the public API report (review/service-bus-node.api.md).
  • Test coverage: unit tests for the deserialization (present → values, absent → undefined) plus a default-api-version assertion, and a live test asserting the counts.

…time properties

Add read-only sqlFilterCount and correlationFilterCount properties to
TopicRuntimeProperties, reporting the total number of SQL and correlation
filters across a topic's subscriptions. These are served by Service Bus
management API version 2024-05, which is now the current api-version.

- Expose sqlFilterCount/correlationFilterCount (optional number, undefined
  when absent), mirroring subscriptionCount
- Deserialize the SqlFilterCount/CorrelationFilterCount ATOM elements
- Bump CURRENT_API_VERSION to 2024-05 and widen the serviceVersion option
- Regenerate the public API report
- Add unit and live tests

Part of a cross-language effort; reference implementation is
Azure/azure-sdk-for-net#61559.
…pic-filter-counts-37720586

# Conflicts:
#	sdk/servicebus/service-bus/CHANGELOG.md

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds topic-level SQL and correlation filter counts to Service Bus administration runtime properties using API version 2024-05.

Changes:

  • Deserializes and exposes both optional filter counts.
  • Updates the default and supported ATOM API versions.
  • Adds unit/live coverage and updates public API documentation.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
CHANGELOG.md Records the new properties and API version.
review/service-bus-node.api.md Updates the public API report.
src/serializers/topicResourceSerializer.ts Maps and defines filter counts.
src/serviceBusAtomManagementClient.ts Adds 2024-05 client support.
src/util/constants.ts Adds XML constants and updates the default version.
src/util/utils.ts Extends the API-version union.
test/internal/unit/atomXml.spec.ts Tests deserialization and default version.
test/public/atomManagement.spec.ts Adds live filter-count validation.

Comment thread sdk/servicebus/service-bus/CHANGELOG.md Resolved
…count live test to one version, add admin snippet, add CHANGELOG PR links

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.

Suppressed comments (1)

sdk/servicebus/service-bus/test/public/atomManagement.spec.ts:676

  • The comprehensive ATOM live suite at line 30 still enumerates only 2021-05 and 2017-04, so the new default version is exercised here only for rule creation and getTopicRuntimeProperties. Since 2024-05 is now sent by default for every administration operation, add it to the suite's supported-version matrix (and use that iteration for this scenario) so regressions in the other queue/topic/subscription/rule operations are covered before changing the default.
    (serviceVersion === "2021-05" ? describe : describe.skip)("Atom management - Topic filter counts", function (): void {
      const filterCountsClient = (): ServiceBusAdministrationClient =>
        new ServiceBusAdministrationClient(getFullyQualifiedNamespace(), createTestCredential(), {
          serviceVersion: "2024-05",

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
9 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.

@j7nw4r Johnathan W (j7nw4r) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I built the package on the PR head and ran the gates. The build and extract-api pass, and the committed service-bus-node.api.md regenerates identically. Lint reports no errors. Prettier is clean. The Node unit suite passes, with 390 tests. I could not run the live suite, because I have no namespace here.

The implementation is correct, and I checked it rather than assumed it. I drove the client through a fake transport with a realistic ATOM entry. The default client sends api-version=2024-05, and both counts land on getTopicRuntimeProperties and on listTopicsRuntimeProperties. A 0 value stays 0, so there is no gap between zero and absent. I also read the merged .NET PR, and your default version bump matches it.

Two things hold this up. The new unit tests build their input from the same constants the code reads with, so they cannot catch a wrong ATOM element name. I proved that by replacing both names with garbage on the PR head, and all 390 tests still passed. Separately, the live suite still pins every assertion to 2021-05 and 2017-04, so the new default that every customer gets has no live coverage. The two threads carry the detail.

The other three comments are small: a describe gate that ties this test's survival to an array 640 lines up the file, an api-version assertion that restates a constant, and a README sample whose counts sit at their floor. The CHANGELOG entries, the TSDoc, and the regenerated api report are all in good shape.

…erage

- Add fake-transport tests that drive the client with a literal ATOM body, so
  the element names SqlFilterCount and CorrelationFilterCount are pinned
  independently of the constants, and cover listTopicsRuntimeProperties.
- Assert the default api-version on the request URL from a default client, and
  the pinned value when the caller supplies one, replacing the constant
  equality check.
- Run the live admin suite at 2024-05 as well, and carry the two new
  properties in the expected topic runtime objects, version aware. Without
  this the runtime info tests fail at every api-version, since the properties
  are present as keys even where the value is undefined.
- Move the topic filter count live block beside the suite so it runs once
  without a version gate, and manage its own topic lifecycle.
- Create a subscription and a correlation rule in the admin sample so the
  counts aggregate, and regenerate the README snippet.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated no new comments.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated no new comments.

@EldertGrootenboer
Eldert Grootenboer (EldertGrootenboer) merged commit bd459db into main Aug 14, 2026
14 checks passed
@EldertGrootenboer
Eldert Grootenboer (EldertGrootenboer) deleted the feature/servicebus-topic-filter-counts-37720586 branch August 14, 2026 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants