Skip to content

[Service Bus] Clarify and sample session listing - #50194

Open
Eldert Grootenboer (EldertGrootenboer) wants to merge 5 commits into
mainfrom
sample/servicebus-list-sessions
Open

[Service Bus] Clarify and sample session listing#50194
Eldert Grootenboer (EldertGrootenboer) wants to merge 5 commits into
mainfrom
sample/servicebus-list-sessions

Conversation

@EldertGrootenboer

Copy link
Copy Markdown
Member

Summary

Adds synchronous and asynchronous samples for listing Service Bus sessions, and corrects the surrounding documentation to describe both supported modes:

  • Default listing returns sessions with active messages or stored session state.
  • Supplying sessionStateUpdatedAfter returns sessions whose stored state was set or updated after the cutoff.

Internal sentinel and test names now use "default listing" terminology. No runtime behavior or public API changes.

Testing

  • mvn --batch-mode -ntp -f sdk/servicebus/azure-messaging-servicebus/pom.xml -DskipTests -Dspotbugs.skip=true test-compile checkstyle:check
  • Build succeeded with zero Checkstyle violations.

Related implementation: #48956

@azure-pipelines

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

@EldertGrootenboer
Eldert Grootenboer (EldertGrootenboer) marked this pull request as ready for review August 19, 2026 20:23
Copilot AI lite review requested due to automatic review settings August 19, 2026 20:23
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
35 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

This PR clarifies the semantics of Service Bus session listing (default listing vs. listing by session-state update cutoff) and adds end-to-end samples demonstrating both synchronous and asynchronous session listing.

Changes:

  • Added new sync/async samples for listing session IDs and linked them from the samples README.
  • Updated documentation/comments/tests to use “default listing” terminology and describe the two supported listing modes.
  • Renamed and propagated the internal sentinel constant used for “default listing” mode.

Reviewed changes

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

Show a summary per file
File Description
sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusSessionReceiverAsyncClientTest.java Updates terminology and sentinel usage in async session receiver paging tests.
sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/implementation/ManagementChannelTests.java Updates terminology in management-channel tests for the default listing sentinel.
sdk/servicebus/azure-messaging-servicebus/src/samples/README.md Adds sample links for session listing (sync + async).
sdk/servicebus/azure-messaging-servicebus/src/samples/java/com/azure/messaging/servicebus/ListSessionsSample.java New synchronous sample demonstrating default listing and cutoff-based listing.
sdk/servicebus/azure-messaging-servicebus/src/samples/java/com/azure/messaging/servicebus/ListSessionsAsyncSample.java New asynchronous sample demonstrating default listing and cutoff-based listing.
sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusSessionReceiverClient.java Updates public JavaDoc to reflect default listing behavior and cutoff semantics.
sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusSessionReceiverAsyncClient.java Updates public JavaDoc and switches no-arg listing to the renamed default-listing sentinel.
sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/implementation/ServiceBusManagementNode.java Updates internal JavaDoc to describe default listing vs cutoff mode and sentinel usage.
sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/implementation/ManagementConstants.java Renames the sentinel constant and updates its documentation to “default listing” semantics.
sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/implementation/ManagementChannel.java Updates sentinel name in clamping logic/comments for the management operation.
sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md Updates changelog wording for the new/clarified session listing behavior.
Suppressed comments (2)

sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusSessionReceiverClient.java:236

  • The JavaDoc for listSessions(OffsetDateTime) no longer documents the clamping behavior for values at/after the Track 1 sentinel (e.g., OffsetDateTime.MAX). The implementation still clamps such inputs in the management layer, so the current "updated after the specified time" description is inaccurate for these values.
    /**
    * Lists the IDs of sessions whose state was set or updated after the specified time.
     *
     * <p>The returned {@link PagedIterable} fetches additional pages from the broker on demand;
     * iterate the {@code PagedIterable} (or call {@link PagedIterable#stream()}) to receive every

sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusSessionReceiverAsyncClient.java:341

  • The JavaDoc for listSessions(OffsetDateTime) no longer documents the clamping behavior for values at/after the Track 1 sentinel (e.g., OffsetDateTime.MAX). The implementation still clamps such inputs in the management layer, so the current "updated after the specified time" description is inaccurate for these values.
    /**
    * Lists the IDs of sessions whose state was set or updated after the specified time.
     *
     * <p>The returned {@link PagedFlux} fetches additional pages from the broker on demand using
     * cursor-based pagination (server-returned {@code skip} plus {@code lastSessionId} of the

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md Outdated
@EldertGrootenboer
Eldert Grootenboer (EldertGrootenboer) marked this pull request as ready for review August 19, 2026 20:44
@azure-pipelines

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

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.

2 participants