feat: Add topic SqlFilterCount and CorrelationFilterCount runtime properties - #50022
feat: Add topic SqlFilterCount and CorrelationFilterCount runtime properties#50022EldertGrootenboer wants to merge 3 commits into
Conversation
…perties - Add getSqlFilterCount() and getCorrelationFilterCount() to TopicRuntimeProperties, exposing the total number of SQL and correlation filters across all of a topic's subscriptions - Add ServiceBusServiceVersion.V2024_05 and make it the latest; the administration client now sends api-version=2024-05 by default, which the topic filter counts require - Parse SqlFilterCount/CorrelationFilterCount ATOM elements onto TopicDescription and default to 0 when absent (older region or api-version) - Add a swagger codegen directive so a regeneration reproduces the two fields instead of dropping them - Add unit tests (service-version default and mapping, propagate and default-to-zero, XML round-trip) and a live integration test asserting the counts
…pic-filter-counts-37720586 # Conflicts: # sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md
There was a problem hiding this comment.
Pull request overview
This PR extends the Azure Service Bus administration client to surface topic-level runtime counts for SQL and correlation filters, and updates the default administration api-version to 2024-05 to enable the service to return these new fields.
Changes:
- Added
sqlFilterCountandcorrelationFilterCountplumbing from generatedTopicDescription→TopicProperties→ publicTopicRuntimeProperties. - Introduced
ServiceBusServiceVersion.V2024_05and made it the default/latest service version. - Added unit and live integration coverage for version mapping, runtime-property propagation/defaulting, and XML serialization/deserialization.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| sdk/servicebus/azure-messaging-servicebus/swagger/README.md | Injects SqlFilterCount / CorrelationFilterCount into TopicDescription via an AutoRest directive for the pinned swagger. |
| sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusServiceVersionTest.java | Verifies latest version selection and enum → api-version string mapping. |
| sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/implementation/ServiceBusManagementSerializerTest.java | Adds XML round-trip test coverage for the new topic filter-count elements. |
| sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/administration/TopicRuntimePropertiesTest.java | Validates propagation to public TopicRuntimeProperties and default-to-zero behavior when absent. |
| sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/administration/ServiceBusAdministrationClientIntegrationTest.java | Adds a live-only test that creates rules and validates the returned topic-level filter counts. |
| sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusServiceVersion.java | Adds V2024_05 and updates getLatest() to return it. |
| sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/administration/models/TopicRuntimeProperties.java | Adds public getters for SQL/correlation filter counts. |
| sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/administration/models/TopicProperties.java | Captures filter counts from TopicDescription and exposes internal getters for runtime model construction. |
| sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/administration/implementation/models/TopicDescription.java | Adds generated fields, XML (de)serialization, and accessors for the new counts. |
| sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md | Documents the new runtime properties and service-version default change. |
There was a problem hiding this comment.
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/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/administration/ServiceBusAdministrationClientIntegrationTest.java:552
- This integration test is currently gated to
TestMode.LIVEonly, so it will be skipped in bothRECORD(when recordings are created) andPLAYBACK(the default CI mode for proxy-based tests). That makes the test effectively non-executing in normal runs and increases the risk that it silently breaks over time.
Consider allowing RECORD as well (recordings can be captured from a feature-enabled namespace), and optionally later enabling PLAYBACK once a stable recording exists.
assumeTrue(super.getTestMode() == TestMode.LIVE, "Filter counts require a live feature-enabled namespace.");
The default administration api-version is now 2024-05 (getLatest()), which the recorded playback tests would send, but their session recordings were captured at 2021-05, so the test proxy could not match the requests. - Pin the recorded (playback/record) modes to ServiceBusServiceVersion.V2021_05 in the shared configure() and the impl-client and unauthorized-client builders; live mode keeps the latest default. - Mark getTopicFilterCounts with @liveonly so it skips cleanly in playback (it needs the 2024-05 default and a feature-enabled live namespace, and has no recording), instead of failing setup on a missing recording.
|
Azure Pipelines: Successfully started running 1 pipeline(s). 34 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Description
Adds the topic-level
SqlFilterCountandCorrelationFilterCountruntime properties to the Service Bus administration client, porting the merged .NET implementation (Azure/azure-sdk-for-net#61559) to Java.API additions
TopicRuntimeProperties.getSqlFilterCount()andgetCorrelationFilterCount()— the total number of SQL / correlation filters across all of a topic's subscriptions, populated bygetTopicRuntimeProperties/getTopicsRuntimeProperties.ServiceBusServiceVersion.V2024_05, now the latest. The administration client sendsapi-version=2024-05by default, which the service requires to serve the filter counts. Existing operations are unaffected, and callers can still pin an earlier version.Behavior
2024-05service API version and by regions that have deployed the feature. When absent (older api-version or region), they default to0.Code generation
TopicDescriptionvia a swagger directive, because the pinned2021-05input swagger does not yet define them. A regeneration therefore reproduces the fields (verified by runningautorestlocally — the regeneratedTopicDescriptionmatches the committed file). The directive is to be removed once theinput-fileis bumped to a spec revision that defines the properties.Tests
SqlFilterCount == 2(the$DefaultTrueFilter + the explicit SQL rule) andCorrelationFilterCount == 1. Validated against a live namespace.Checklist