From a902b8670f73f49bbb82a19d9d80697dedc48a4e Mon Sep 17 00:00:00 2001 From: Eldert Grootenboer Date: Wed, 19 Aug 2026 11:55:00 -0700 Subject: [PATCH 1/6] docs(servicebus): clarify and sample session listing --- .../azure-messaging-servicebus/CHANGELOG.md | 2 +- .../ServiceBusSessionReceiverAsyncClient.java | 41 +++++------- .../ServiceBusSessionReceiverClient.java | 31 ++++----- .../implementation/ManagementChannel.java | 9 +-- .../implementation/ManagementConstants.java | 7 +- .../ServiceBusManagementNode.java | 16 ++--- .../src/samples/README.md | 4 ++ .../servicebus/ListSessionsAsyncSample.java | 67 +++++++++++++++++++ .../servicebus/ListSessionsSample.java | 61 +++++++++++++++++ ...viceBusSessionReceiverAsyncClientTest.java | 16 ++--- .../ManagementChannelTests.java | 12 ++-- 11 files changed, 194 insertions(+), 72 deletions(-) create mode 100644 sdk/servicebus/azure-messaging-servicebus/src/samples/java/com/azure/messaging/servicebus/ListSessionsAsyncSample.java create mode 100644 sdk/servicebus/azure-messaging-servicebus/src/samples/java/com/azure/messaging/servicebus/ListSessionsSample.java diff --git a/sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md b/sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md index 2272155fb763..b189caee9b50 100644 --- a/sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md +++ b/sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md @@ -4,7 +4,7 @@ ### Features Added -- Added `listSessions()` and `listSessions(OffsetDateTime sessionStateUpdatedAfter)` to `ServiceBusSessionReceiverAsyncClient` (returning `PagedFlux`) and `ServiceBusSessionReceiverClient` (returning `PagedIterable`). The no-arg overload returns sessions with active messages; the `sessionStateUpdatedAfter` overload returns sessions whose session state was updated after the given timestamp. Implements the `com.microsoft:get-message-sessions` AMQP management operation. ([#48956](https://github.com/Azure/azure-sdk-for-java/pull/48956)) +- Added `listSessions()` and `listSessions(OffsetDateTime sessionStateUpdatedAfter)` to `ServiceBusSessionReceiverAsyncClient` (returning `PagedFlux`) and `ServiceBusSessionReceiverClient` (returning `PagedIterable`). The no-arg overload returns sessions with active messages or stored session state; the `sessionStateUpdatedAfter` overload returns sessions whose session state was updated after the given timestamp. Implements the `com.microsoft:get-message-sessions` AMQP management operation. ([#48956](https://github.com/Azure/azure-sdk-for-java/pull/48956)) - Added `getSqlFilterCount()` and `getCorrelationFilterCount()` to `TopicRuntimeProperties`, exposing the total number of SQL filters and correlation filters across all of a topic's subscriptions. - Added `ServiceBusServiceVersion.V2024_05` and made it the latest version. The administration client now uses `api-version=2024-05` by default, which is required for the topic filter counts above. diff --git a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusSessionReceiverAsyncClient.java b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusSessionReceiverAsyncClient.java index 4d45b517d086..518112f045df 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusSessionReceiverAsyncClient.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusSessionReceiverAsyncClient.java @@ -313,43 +313,36 @@ private Mono acquireSpecificOrNextSession(String } /** - * Lists the IDs of sessions that have active messages in this entity. + * Lists the IDs of sessions that have active messages or stored session state in this entity. * - *

Only sessions with active messages in the queue or subscription are returned. - * Sessions on the dead-letter queue or sessions having only a session state (but no messages) - * are not returned.

- * - *

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 - * previous page) and terminates when the broker returns a page smaller than the requested page - * size (a short or empty page signals the end). The default page size is 100; callers can - * request a different size via {@link PagedFlux#byPage(int)}.

- * - * @return A {@link PagedFlux} of session ID strings. - */ + *

Sessions with active messages or stored session state in the queue or subscription are + * returned. Sessions with neither are excluded. Sessions on the dead-letter queue are not + * returned.

+ * + *

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 + * previous page) and terminates when the broker returns a page smaller than the requested page + * size (a short or empty page signals the end). The default page size is 100; callers can + * request a different size via {@link PagedFlux#byPage(int)}.

+ * + * @return A {@link PagedFlux} of session ID strings. + */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listSessions() { // Wire value matches Track 1's SessionBrowser.MAXDATE so the broker switches into the - // active-messages mode it has historically been validated against. - return listSessionsInternal(ManagementConstants.ACTIVE_MESSAGES_SENTINEL); + // default listing mode for sessions with active messages or stored session state. + return listSessionsInternal(ManagementConstants.DEFAULT_LISTING_SENTINEL); } /** - * Lists the IDs of sessions whose state was updated after the specified time. + * Lists the IDs of sessions whose state was set or updated after the specified time. * *

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 * previous page) and terminates when the broker returns a page smaller than the requested page * size (a short or empty page signals the end). The default page size is 100; callers can * request a different size via {@link PagedFlux#byPage(int)}.

- * - *

Values at or beyond the active-messages sentinel value - * ({@code new Date(253402300800000L)}, rendered by {@code OffsetDateTime.toString()} as - * {@code +10000-01-01T00:00Z}, matching Track 1's {@code SessionBrowser.MAXDATE}) are clamped - * to that sentinel and behave the same as {@link #listSessions()}, returning sessions that - * have active messages.

- * - * @param sessionStateUpdatedAfter Only sessions whose session state was updated after this time are returned. + * @param sessionStateUpdatedAfter Only sessions whose session state was set or updated after this time are returned. * @return A {@link PagedFlux} of session ID strings. * @throws NullPointerException if {@code sessionStateUpdatedAfter} is null. */ diff --git a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusSessionReceiverClient.java b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusSessionReceiverClient.java index 6bb7f1130efc..a98cb648d3b0 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusSessionReceiverClient.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusSessionReceiverClient.java @@ -212,37 +212,32 @@ public ServiceBusReceiverClient acceptSession(String sessionId) { } /** - * Lists the IDs of sessions that have active messages in this entity. + * Lists the IDs of sessions that have active messages or stored session state in this entity. * - *

The returned {@link PagedIterable} fetches additional pages from the broker on demand; - * iterate the {@code PagedIterable} (or call {@link PagedIterable#stream()}) to receive every - * session ID. Pages are fetched lazily as the iterator advances. The default page size is 100; - * callers can request a different size via {@link PagedIterable#iterableByPage(int)} (or the - * equivalent on the underlying {@code PagedFlux}).

- * - * @return A {@link PagedIterable} of session ID strings. - */ + *

Sessions with neither active messages nor stored session state are excluded.

+ * + *

The returned {@link PagedIterable} fetches additional pages from the broker on demand; + * iterate the {@code PagedIterable} (or call {@link PagedIterable#stream()}) to receive every + * session ID. Pages are fetched lazily as the iterator advances. The default page size is 100; + * callers can request a different size via {@link PagedIterable#iterableByPage(int)} (or the + * equivalent on the underlying {@code PagedFlux}).

+ * + * @return A {@link PagedIterable} of session ID strings. + */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listSessions() { return new PagedIterable<>(sessionAsyncClient.listSessions()); } /** - * Lists the IDs of sessions whose state was updated after the specified time. + * Lists the IDs of sessions whose state was set or updated after the specified time. * *

The returned {@link PagedIterable} fetches additional pages from the broker on demand; * iterate the {@code PagedIterable} (or call {@link PagedIterable#stream()}) to receive every * session ID. Pages are fetched lazily as the iterator advances. The default page size is 100; * callers can request a different size via {@link PagedIterable#iterableByPage(int)} (or the * equivalent on the underlying {@code PagedFlux}).

- * - *

Values at or beyond the active-messages sentinel value - * ({@code new Date(253402300800000L)}, rendered by {@code OffsetDateTime.toString()} as - * {@code +10000-01-01T00:00Z}, matching Track 1's {@code SessionBrowser.MAXDATE}) are clamped - * to that sentinel and behave the same as {@link #listSessions()}, returning sessions that - * have active messages.

- * - * @param sessionStateUpdatedAfter Only sessions whose session state was updated after this time are returned. + * @param sessionStateUpdatedAfter Only sessions whose session state was set or updated after this time are returned. * @return A {@link PagedIterable} of session ID strings. * @throws NullPointerException if {@code sessionStateUpdatedAfter} is null. */ diff --git a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/implementation/ManagementChannel.java b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/implementation/ManagementChannel.java index 9331097ec5d7..5a8ab347a07f 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/implementation/ManagementChannel.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/implementation/ManagementChannel.java @@ -521,17 +521,18 @@ public Mono getMessageSessions(OffsetDateTime lastUpdated return monoError(logger, new IllegalArgumentException("'top' must be positive; got " + top + ".")); } - // Track 1's SessionBrowser uses new Date(253402300800000L) as the active-messages sentinel + // Track 1's SessionBrowser uses new Date(253402300800000L) as the default-listing sentinel // (1ms past 9999-12-31T23:59:59.999Z, rendered by OffsetDateTime.toString() as // +10000-01-01T00:00Z). This is the wire value the broker has been validated against for - // years; align with it here. Any input at or beyond that instant (including + // listing sessions with active messages or stored session state; align with it here. Any + // input at or beyond that instant (including // OffsetDateTime.MAX, whose nanosecond precision and year-999_999_999 value would otherwise // overflow java.util.Date) is clamped to it so the sentinel comparison and Date.from(...) // both stay well-defined. Comparing with >= so the sentinel-equal case is also routed // through the clamp explicitly (it's a no-op for equal values, but keeps the comment/code // contract precise). - final OffsetDateTime cappedTime = lastUpdatedTime.compareTo(ManagementConstants.ACTIVE_MESSAGES_SENTINEL) >= 0 - ? ManagementConstants.ACTIVE_MESSAGES_SENTINEL + final OffsetDateTime cappedTime = lastUpdatedTime.compareTo(ManagementConstants.DEFAULT_LISTING_SENTINEL) >= 0 + ? ManagementConstants.DEFAULT_LISTING_SENTINEL : lastUpdatedTime; return isAuthorized(OPERATION_GET_MESSAGE_SESSIONS).then(channelCache.get().flatMap(channel -> { diff --git a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/implementation/ManagementConstants.java b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/implementation/ManagementConstants.java index 728e9efb8a16..4cfd8994323c 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/implementation/ManagementConstants.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/implementation/ManagementConstants.java @@ -36,8 +36,9 @@ public class ManagementConstants { public static final String SESSION_IDS = "sessions-ids"; /** - * Sentinel timestamp the broker recognizes as "list sessions with active messages" mode for the - * {@code OPERATION_GET_MESSAGE_SESSIONS} operation. Matches Track 1's + * Sentinel timestamp the broker recognizes as the default list mode for the + * {@code OPERATION_GET_MESSAGE_SESSIONS} operation. This mode returns sessions with active + * messages or stored session state and excludes sessions with neither. Matches Track 1's * {@code SessionBrowser.MAXDATE = new Date(253402300800000L)} * (rendered by {@link OffsetDateTime#toString()} as {@code +10000-01-01T00:00Z} - the leading * {@code +} is required by ISO 8601 for years with more than four digits); using any other @@ -45,7 +46,7 @@ public class ManagementConstants { * so callers and the implementation can clamp inputs via {@link OffsetDateTime#compareTo} * without each owning their own copy. */ - public static final OffsetDateTime ACTIVE_MESSAGES_SENTINEL + public static final OffsetDateTime DEFAULT_LISTING_SENTINEL = OffsetDateTime.of(10000, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC); public static final String LAST_UPDATED_TIME = "last-updated-time"; public static final String LAST_SESSION_ID = "last-session-id"; diff --git a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/implementation/ServiceBusManagementNode.java b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/implementation/ServiceBusManagementNode.java index e05facd030f0..ce08abd54ca1 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/implementation/ServiceBusManagementNode.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/implementation/ServiceBusManagementNode.java @@ -149,8 +149,7 @@ Mono updateDisposition(String lockToken, DispositionStatus dispositionStat Flux listRules(); /** - * Lists the session IDs for sessions that have active messages or whose state was updated - * since the given time. + * Lists session IDs using either the default listing mode or a session-state update cutoff. * *

Pagination follows the cursor semantics of Track 1's * {@code com.microsoft.azure.servicebus.SessionBrowser}: the caller threads {@code skip} from @@ -158,12 +157,13 @@ Mono updateDisposition(String lockToken, DispositionStatus dispositionStat * (the last entry of the previous page) into the next request, and stops when the broker returns * a page smaller than the requested page size (a short or empty page signals the end).

* - * @param lastUpdatedTime Filter timestamp. To get sessions with active messages, pass the - * {@link ManagementConstants#ACTIVE_MESSAGES_SENTINEL} sentinel (the implementation also - * accepts {@link OffsetDateTime#MAX} and clamps it to that sentinel), which matches the - * Track 1 Java sentinel value ({@code new Date(253402300800000L)}, rendered by - * {@code OffsetDateTime.toString()} as {@code +10000-01-01T00:00Z}). Pass a real timestamp - * to get sessions updated since that time. + * @param lastUpdatedTime Filter timestamp. To use the default listing mode for sessions with + * active messages or stored session state, pass the + * {@link ManagementConstants#DEFAULT_LISTING_SENTINEL} sentinel (the implementation also + * accepts {@link OffsetDateTime#MAX} and clamps it to that sentinel), which matches the + * Track 1 Java sentinel value ({@code new Date(253402300800000L)}, rendered by + * {@code OffsetDateTime.toString()} as {@code +10000-01-01T00:00Z}). Pass a real timestamp + * to get sessions updated since that time. * @param skip Pagination offset (from {@link MessageSessionsResult#getNextSkip()} of the * previous page, or {@code 0} for the first page). * @param top Page size. diff --git a/sdk/servicebus/azure-messaging-servicebus/src/samples/README.md b/sdk/servicebus/azure-messaging-servicebus/src/samples/README.md index 713a2d33b116..6c5f90909fbf 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/samples/README.md +++ b/sdk/servicebus/azure-messaging-servicebus/src/samples/README.md @@ -51,6 +51,8 @@ connection string value can be obtained by: - [Process all session messages using processor][ServiceBusSessionProcessorSample] - [Receive messages from a specific session][ReceiveNamedSessionAsyncSample] - [Receive messages from the first available session][ReceiveSingleSessionAsyncSample] +- [List session IDs synchronously][ListSessionsSample] +- [List session IDs asynchronously][ListSessionsAsyncSample] ### Synchronous Administration Client operations - [Update queue properties synchronously][AdministrationClientUpdateQueueSample] @@ -79,6 +81,8 @@ Guidelines](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.m [sdk_readme_next_steps]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/servicebus/azure-messaging-servicebus/README.md#next-steps [PeekMessageAsyncSample]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/servicebus/azure-messaging-servicebus/src/samples/java/com/azure/messaging/servicebus/PeekMessageAsyncSample.java +[ListSessionsAsyncSample]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/servicebus/azure-messaging-servicebus/src/samples/java/com/azure/messaging/servicebus/ListSessionsAsyncSample.java +[ListSessionsSample]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/servicebus/azure-messaging-servicebus/src/samples/java/com/azure/messaging/servicebus/ListSessionsSample.java [ReceiveMessageAndSettleAsyncSample]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/servicebus/azure-messaging-servicebus/src/samples/java/com/azure/messaging/servicebus/ReceiveMessageAndSettleAsyncSample.java [ReceiveMessageAsyncSample]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/servicebus/azure-messaging-servicebus/src/samples/java/com/azure/messaging/servicebus/ReceiveMessageAsyncSample.java [ReceiveMessageAutoLockRenewal]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/servicebus/azure-messaging-servicebus/src/samples/java/com/azure/messaging/servicebus/ReceiveMessageAutoLockRenewal.java diff --git a/sdk/servicebus/azure-messaging-servicebus/src/samples/java/com/azure/messaging/servicebus/ListSessionsAsyncSample.java b/sdk/servicebus/azure-messaging-servicebus/src/samples/java/com/azure/messaging/servicebus/ListSessionsAsyncSample.java new file mode 100644 index 000000000000..f7115deae0df --- /dev/null +++ b/sdk/servicebus/azure-messaging-servicebus/src/samples/java/com/azure/messaging/servicebus/ListSessionsAsyncSample.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.messaging.servicebus; + +import org.junit.jupiter.api.Test; + +import java.time.OffsetDateTime; +import java.time.ZoneOffset; +import java.util.concurrent.CountDownLatch; + +/** + * Demonstrates how to asynchronously list sessions using both supported modes. Default listing returns sessions with + * active messages or stored session state and excludes sessions with neither. A cutoff returns only sessions whose + * stored state was set or updated after that time. + */ +public class ListSessionsAsyncSample { + String connectionString = System.getenv("AZURE_SERVICEBUS_NAMESPACE_CONNECTION_STRING"); + String topicName = System.getenv("AZURE_SERVICEBUS_SAMPLE_TOPIC_NAME"); + String subscriptionName = System.getenv("AZURE_SERVICEBUS_SAMPLE_SESSION_SUBSCRIPTION_NAME"); + + /** + * Main method to invoke this demo on how to list session IDs in a Service Bus topic subscription. + * + * @param args Unused arguments to the program. + * @throws InterruptedException If the program is interrupted while waiting for the operation to complete. + */ + public static void main(String[] args) throws InterruptedException { + ListSessionsAsyncSample sample = new ListSessionsAsyncSample(); + sample.run(); + } + + /** + * Lists sessions using both supported modes. + * + * @throws InterruptedException If the program is interrupted while waiting for the operation to complete. + */ + @Test + public void run() throws InterruptedException { + CountDownLatch countdownLatch = new CountDownLatch(1); + ServiceBusSessionReceiverAsyncClient sessionReceiver = new ServiceBusClientBuilder() + .connectionString(connectionString) + .sessionReceiver() + .topicName(topicName) + .subscriptionName(subscriptionName) + .buildAsyncClient(); + + try { + OffsetDateTime sessionStateUpdatedAfter = OffsetDateTime.now(ZoneOffset.UTC).minusDays(7); + + sessionReceiver.listSessions() + .doOnNext(sessionId -> System.out.println("Session ID: " + sessionId)) + .thenMany(sessionReceiver.listSessions(sessionStateUpdatedAfter)) + .subscribe( + sessionId -> System.out.println("Recently updated session ID: " + sessionId), + error -> { + System.err.println("Error occurred: " + error); + countdownLatch.countDown(); + }, + countdownLatch::countDown); + + countdownLatch.await(); + } finally { + sessionReceiver.close(); + } + } +} diff --git a/sdk/servicebus/azure-messaging-servicebus/src/samples/java/com/azure/messaging/servicebus/ListSessionsSample.java b/sdk/servicebus/azure-messaging-servicebus/src/samples/java/com/azure/messaging/servicebus/ListSessionsSample.java new file mode 100644 index 000000000000..525d98e65ee7 --- /dev/null +++ b/sdk/servicebus/azure-messaging-servicebus/src/samples/java/com/azure/messaging/servicebus/ListSessionsSample.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.messaging.servicebus; + +import org.junit.jupiter.api.Test; + +import java.time.OffsetDateTime; +import java.time.ZoneOffset; + +/** + * Demonstrates how to list sessions using both supported modes. Default listing returns sessions with active messages + * or stored session state and excludes sessions with neither. A cutoff returns only sessions whose stored state was set + * or updated after that time. + */ +public class ListSessionsSample { + String connectionString = System.getenv("AZURE_SERVICEBUS_NAMESPACE_CONNECTION_STRING"); + String queueName = System.getenv("AZURE_SERVICEBUS_SAMPLE_SESSION_QUEUE_NAME"); + + /** + * Main method to invoke this demo on how to list session IDs in a Service Bus queue. + * + * @param args Unused arguments to the program. + */ + public static void main(String[] args) { + ListSessionsSample sample = new ListSessionsSample(); + sample.run(); + } + + /** + * Lists sessions using both supported modes. + */ + @Test + public void run() { + ServiceBusSessionReceiverClient sessionReceiver = new ServiceBusClientBuilder() + .connectionString(connectionString) + .sessionReceiver() + .queueName(queueName) + .buildClient(); + + try { + listSessionsWithMessagesOrState(sessionReceiver); + listSessionsWithRecentlyUpdatedState(sessionReceiver); + } finally { + sessionReceiver.close(); + } + } + + private static void listSessionsWithMessagesOrState(ServiceBusSessionReceiverClient sessionReceiver) { + // Omitting the cutoff returns sessions with active messages or stored session state. + sessionReceiver.listSessions() + .forEach(sessionId -> System.out.println("Session ID: " + sessionId)); + } + + private static void listSessionsWithRecentlyUpdatedState(ServiceBusSessionReceiverClient sessionReceiver) { + // Supplying a cutoff returns only sessions whose stored state was set or updated after that time. + OffsetDateTime sessionStateUpdatedAfter = OffsetDateTime.now(ZoneOffset.UTC).minusDays(7); + sessionReceiver.listSessions(sessionStateUpdatedAfter) + .forEach(sessionId -> System.out.println("Recently updated session ID: " + sessionId)); + } +} diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusSessionReceiverAsyncClientTest.java b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusSessionReceiverAsyncClientTest.java index a535665e38ee..aa6ee8d8b6d1 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusSessionReceiverAsyncClientTest.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusSessionReceiverAsyncClientTest.java @@ -401,19 +401,19 @@ private static List fullPage(String prefix) { } /** - * Verifies the no-arg listSessions() drives the broker with the active-messages sentinel and + * Verifies the no-arg listSessions() drives the broker with the default-listing sentinel and * collects every page until the broker returns a short page (fewer IDs than the requested page * size), which terminates pagination. */ @Test - void listSessionsActiveModeStreamsAllPagesUntilShortPage() { + void listSessionsDefaultListingModeStreamsAllPagesUntilShortPage() { // First page: a full page (100 sessions) continues; server-returned skip = 100. final List firstPage = fullPage("s"); - when(managementNode.getMessageSessions(eq(ManagementConstants.ACTIVE_MESSAGES_SENTINEL), eq(0), eq(100), + when(managementNode.getMessageSessions(eq(ManagementConstants.DEFAULT_LISTING_SENTINEL), eq(0), eq(100), isNull())).thenReturn(Mono.just(new MessageSessionsResult(firstPage, 100))); // Cursor for the second page is server-skip (100) + base64url(lastSessionId "s99"). The second // page is short (2 < 100), which terminates pagination. - when(managementNode.getMessageSessions(eq(ManagementConstants.ACTIVE_MESSAGES_SENTINEL), eq(100), eq(100), + when(managementNode.getMessageSessions(eq(ManagementConstants.DEFAULT_LISTING_SENTINEL), eq(100), eq(100), eq("s99"))).thenReturn(Mono.just(new MessageSessionsResult(Arrays.asList("t1", "t2"), 102))); final ServiceBusSessionReceiverAsyncClient client = newSessionReceiver(); @@ -479,11 +479,11 @@ void listSessionsRoundTripsArbitrarySessionIdsThroughCursor() { // page encodes it; a full page also drives the second request under short-page termination. final List firstPage = fullPage("x", 99); firstPage.add(sessionWithPipe); - when(managementNode.getMessageSessions(eq(ManagementConstants.ACTIVE_MESSAGES_SENTINEL), eq(0), eq(100), + when(managementNode.getMessageSessions(eq(ManagementConstants.DEFAULT_LISTING_SENTINEL), eq(0), eq(100), isNull())).thenReturn(Mono.just(new MessageSessionsResult(firstPage, 100))); // The second-page request must decode the cursor back to lastSessionId=sessionWithPipe intact // (pipe and all); the short (empty) page then terminates pagination. - when(managementNode.getMessageSessions(eq(ManagementConstants.ACTIVE_MESSAGES_SENTINEL), eq(100), eq(100), + when(managementNode.getMessageSessions(eq(ManagementConstants.DEFAULT_LISTING_SENTINEL), eq(100), eq(100), eq(sessionWithPipe))).thenReturn(Mono.just(new MessageSessionsResult(Collections.emptyList(), 100))); final ServiceBusSessionReceiverAsyncClient client = newSessionReceiver(); @@ -563,9 +563,9 @@ void listSessionsHonorsCallerPageSize() { // page is full (25 items) so a second page is requested; the short second page (1 < 25) // terminates pagination. final List firstPage = fullPage("s", 25); - when(managementNode.getMessageSessions(eq(ManagementConstants.ACTIVE_MESSAGES_SENTINEL), eq(0), eq(25), + when(managementNode.getMessageSessions(eq(ManagementConstants.DEFAULT_LISTING_SENTINEL), eq(0), eq(25), isNull())).thenReturn(Mono.just(new MessageSessionsResult(firstPage, 25))); - when(managementNode.getMessageSessions(eq(ManagementConstants.ACTIVE_MESSAGES_SENTINEL), eq(25), eq(25), + when(managementNode.getMessageSessions(eq(ManagementConstants.DEFAULT_LISTING_SENTINEL), eq(25), eq(25), eq("s24"))).thenReturn(Mono.just(new MessageSessionsResult(Collections.singletonList("t1"), 26))); final ServiceBusSessionReceiverAsyncClient client = newSessionReceiver(); diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/implementation/ManagementChannelTests.java b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/implementation/ManagementChannelTests.java index 6026ba0a218e..17af17b5fc33 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/implementation/ManagementChannelTests.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/implementation/ManagementChannelTests.java @@ -1116,14 +1116,14 @@ void getMessageSessionsSessionStateUpdatedAfterMode() { } /** - * Verifies getMessageSessions in active-messages mode uses the Track 1 active-messages sentinel. + * Verifies getMessageSessions in default listing mode uses the Track 1 default-listing sentinel. * Track 1's {@code SessionBrowser.MAXDATE} is {@code new Date(253402300800000L)} * (10000-01-01T00:00:00Z UTC, 1 ms past 9999-12-31T23:59:59.999Z), which the broker recognizes - * as the "list sessions with active messages" mode. + * as the mode that lists sessions with active messages or stored session state. */ @Test - void getMessageSessionsActiveMessagesMode() { - // Arrange - Track 1 active-messages sentinel (10000-01-01T00:00:00Z UTC). + void getMessageSessionsDefaultListingMode() { + // Arrange - Track 1 default-listing sentinel (10000-01-01T00:00:00Z UTC). final OffsetDateTime sentinel = OffsetDateTime.of(10000, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC); final String[] sessionIds = new String[] { "active-1", "active-2" }; @@ -1271,7 +1271,7 @@ void getMessageSessionsRejectsUnexpectedSessionIdsPayloadType() { /** * Verifies that getMessageSessions clamps inputs at or beyond the Track 1 sentinel down to * the sentinel itself, both to avoid {@link java.util.Date} overflow for {@link OffsetDateTime#MAX} - * and to keep the broker's active-messages comparison stable. + * and to keep the broker's default-listing comparison stable. */ @Test void getMessageSessionsCapsYear() { @@ -1291,7 +1291,7 @@ void getMessageSessionsCapsYear() { .expectComplete() .verify(TIMEOUT); - // Verify the sent timestamp is capped to the Track 1 active-messages sentinel. + // Verify the sent timestamp is capped to the Track 1 default-listing sentinel. verify(requestResponseChannel).sendWithAck(messageCaptor.capture(), isNull()); @SuppressWarnings("unchecked") final Map body From f4a05b89caec1ebf89fcfff32817587d2d72c6c7 Mon Sep 17 00:00:00 2001 From: Eldert Grootenboer Date: Wed, 19 Aug 2026 15:36:32 -0700 Subject: [PATCH 2/6] docs: address list sessions review feedback --- .../azure-messaging-servicebus/CHANGELOG.md | 2 +- .../ServiceBusSessionReceiverAsyncClient.java | 22 +++++++++---------- .../ServiceBusSessionReceiverClient.java | 22 +++++++++---------- .../implementation/ManagementConstants.java | 6 ++--- .../ServiceBusManagementNode.java | 16 +++++++------- .../servicebus/ListSessionsAsyncSample.java | 3 ++- ...viceBusSessionReceiverAsyncClientTest.java | 2 +- .../ManagementChannelTests.java | 4 ++-- 8 files changed, 39 insertions(+), 38 deletions(-) diff --git a/sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md b/sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md index b189caee9b50..ed54c3b8d0a0 100644 --- a/sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md +++ b/sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md @@ -4,7 +4,7 @@ ### Features Added -- Added `listSessions()` and `listSessions(OffsetDateTime sessionStateUpdatedAfter)` to `ServiceBusSessionReceiverAsyncClient` (returning `PagedFlux`) and `ServiceBusSessionReceiverClient` (returning `PagedIterable`). The no-arg overload returns sessions with active messages or stored session state; the `sessionStateUpdatedAfter` overload returns sessions whose session state was updated after the given timestamp. Implements the `com.microsoft:get-message-sessions` AMQP management operation. ([#48956](https://github.com/Azure/azure-sdk-for-java/pull/48956)) +- Added `listSessions()` and `listSessions(OffsetDateTime sessionStateUpdatedAfter)` to `ServiceBusSessionReceiverAsyncClient` (returning `PagedFlux`) and `ServiceBusSessionReceiverClient` (returning `PagedIterable`). The no-arg overload returns sessions with active messages or stored session state; the `sessionStateUpdatedAfter` overload returns sessions whose session state was set or updated after the given timestamp. Implements the `com.microsoft:get-message-sessions` AMQP management operation. ([#48956](https://github.com/Azure/azure-sdk-for-java/pull/48956)) - Added `getSqlFilterCount()` and `getCorrelationFilterCount()` to `TopicRuntimeProperties`, exposing the total number of SQL filters and correlation filters across all of a topic's subscriptions. - Added `ServiceBusServiceVersion.V2024_05` and made it the latest version. The administration client now uses `api-version=2024-05` by default, which is required for the topic filter counts above. diff --git a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusSessionReceiverAsyncClient.java b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusSessionReceiverAsyncClient.java index 518112f045df..f3eb733eafbe 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusSessionReceiverAsyncClient.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusSessionReceiverAsyncClient.java @@ -318,15 +318,15 @@ private Mono acquireSpecificOrNextSession(String *

Sessions with active messages or stored session state in the queue or subscription are * returned. Sessions with neither are excluded. Sessions on the dead-letter queue are not * returned.

- * - *

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 - * previous page) and terminates when the broker returns a page smaller than the requested page - * size (a short or empty page signals the end). The default page size is 100; callers can - * request a different size via {@link PagedFlux#byPage(int)}.

- * - * @return A {@link PagedFlux} of session ID strings. - */ + * + *

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 + * previous page) and terminates when the broker returns a page smaller than the requested page + * size (a short or empty page signals the end). The default page size is 100; callers can + * request a different size via {@link PagedFlux#byPage(int)}.

+ * + * @return A {@link PagedFlux} of session ID strings. + */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listSessions() { // Wire value matches Track 1's SessionBrowser.MAXDATE so the broker switches into the @@ -335,14 +335,14 @@ public PagedFlux listSessions() { } /** - * Lists the IDs of sessions whose state was set or updated after the specified time. + * Lists the IDs of sessions whose state was set or updated after the specified time. * *

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 * previous page) and terminates when the broker returns a page smaller than the requested page * size (a short or empty page signals the end). The default page size is 100; callers can * request a different size via {@link PagedFlux#byPage(int)}.

- * @param sessionStateUpdatedAfter Only sessions whose session state was set or updated after this time are returned. + * @param sessionStateUpdatedAfter Only sessions whose session state was set or updated after this time are returned. * @return A {@link PagedFlux} of session ID strings. * @throws NullPointerException if {@code sessionStateUpdatedAfter} is null. */ diff --git a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusSessionReceiverClient.java b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusSessionReceiverClient.java index a98cb648d3b0..603025d39b90 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusSessionReceiverClient.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusSessionReceiverClient.java @@ -215,29 +215,29 @@ public ServiceBusReceiverClient acceptSession(String sessionId) { * Lists the IDs of sessions that have active messages or stored session state in this entity. * *

Sessions with neither active messages nor stored session state are excluded.

- * - *

The returned {@link PagedIterable} fetches additional pages from the broker on demand; - * iterate the {@code PagedIterable} (or call {@link PagedIterable#stream()}) to receive every - * session ID. Pages are fetched lazily as the iterator advances. The default page size is 100; - * callers can request a different size via {@link PagedIterable#iterableByPage(int)} (or the - * equivalent on the underlying {@code PagedFlux}).

- * - * @return A {@link PagedIterable} of session ID strings. - */ + * + *

The returned {@link PagedIterable} fetches additional pages from the broker on demand; + * iterate the {@code PagedIterable} (or call {@link PagedIterable#stream()}) to receive every + * session ID. Pages are fetched lazily as the iterator advances. The default page size is 100; + * callers can request a different size via {@link PagedIterable#iterableByPage(int)} (or the + * equivalent on the underlying {@code PagedFlux}).

+ * + * @return A {@link PagedIterable} of session ID strings. + */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listSessions() { return new PagedIterable<>(sessionAsyncClient.listSessions()); } /** - * Lists the IDs of sessions whose state was set or updated after the specified time. + * Lists the IDs of sessions whose state was set or updated after the specified time. * *

The returned {@link PagedIterable} fetches additional pages from the broker on demand; * iterate the {@code PagedIterable} (or call {@link PagedIterable#stream()}) to receive every * session ID. Pages are fetched lazily as the iterator advances. The default page size is 100; * callers can request a different size via {@link PagedIterable#iterableByPage(int)} (or the * equivalent on the underlying {@code PagedFlux}).

- * @param sessionStateUpdatedAfter Only sessions whose session state was set or updated after this time are returned. + * @param sessionStateUpdatedAfter Only sessions whose session state was set or updated after this time are returned. * @return A {@link PagedIterable} of session ID strings. * @throws NullPointerException if {@code sessionStateUpdatedAfter} is null. */ diff --git a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/implementation/ManagementConstants.java b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/implementation/ManagementConstants.java index 4cfd8994323c..79c3c2264eaa 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/implementation/ManagementConstants.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/implementation/ManagementConstants.java @@ -36,9 +36,9 @@ public class ManagementConstants { public static final String SESSION_IDS = "sessions-ids"; /** - * Sentinel timestamp the broker recognizes as the default list mode for the - * {@code OPERATION_GET_MESSAGE_SESSIONS} operation. This mode returns sessions with active - * messages or stored session state and excludes sessions with neither. Matches Track 1's + * Sentinel timestamp the broker recognizes as the default list mode for the + * {@code OPERATION_GET_MESSAGE_SESSIONS} operation. This mode returns sessions with active + * messages or stored session state and excludes sessions with neither. Matches Track 1's * {@code SessionBrowser.MAXDATE = new Date(253402300800000L)} * (rendered by {@link OffsetDateTime#toString()} as {@code +10000-01-01T00:00Z} - the leading * {@code +} is required by ISO 8601 for years with more than four digits); using any other diff --git a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/implementation/ServiceBusManagementNode.java b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/implementation/ServiceBusManagementNode.java index ce08abd54ca1..3a29712bd749 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/implementation/ServiceBusManagementNode.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/implementation/ServiceBusManagementNode.java @@ -149,7 +149,7 @@ Mono updateDisposition(String lockToken, DispositionStatus dispositionStat Flux listRules(); /** - * Lists session IDs using either the default listing mode or a session-state update cutoff. + * Lists session IDs using either the default listing mode or a session-state update cutoff. * *

Pagination follows the cursor semantics of Track 1's * {@code com.microsoft.azure.servicebus.SessionBrowser}: the caller threads {@code skip} from @@ -157,13 +157,13 @@ Mono updateDisposition(String lockToken, DispositionStatus dispositionStat * (the last entry of the previous page) into the next request, and stops when the broker returns * a page smaller than the requested page size (a short or empty page signals the end).

* - * @param lastUpdatedTime Filter timestamp. To use the default listing mode for sessions with - * active messages or stored session state, pass the - * {@link ManagementConstants#DEFAULT_LISTING_SENTINEL} sentinel (the implementation also - * accepts {@link OffsetDateTime#MAX} and clamps it to that sentinel), which matches the - * Track 1 Java sentinel value ({@code new Date(253402300800000L)}, rendered by - * {@code OffsetDateTime.toString()} as {@code +10000-01-01T00:00Z}). Pass a real timestamp - * to get sessions updated since that time. + * @param lastUpdatedTime Filter timestamp. To use the default listing mode for sessions with + * active messages or stored session state, pass the + * {@link ManagementConstants#DEFAULT_LISTING_SENTINEL} sentinel (the implementation also + * accepts {@link OffsetDateTime#MAX} and clamps it to that sentinel), which matches the + * Track 1 Java sentinel value ({@code new Date(253402300800000L)}, rendered by + * {@code OffsetDateTime.toString()} as {@code +10000-01-01T00:00Z}). Pass a real timestamp + * to get sessions updated since that time. * @param skip Pagination offset (from {@link MessageSessionsResult#getNextSkip()} of the * previous page, or {@code 0} for the first page). * @param top Page size. diff --git a/sdk/servicebus/azure-messaging-servicebus/src/samples/java/com/azure/messaging/servicebus/ListSessionsAsyncSample.java b/sdk/servicebus/azure-messaging-servicebus/src/samples/java/com/azure/messaging/servicebus/ListSessionsAsyncSample.java index f7115deae0df..da716cf9dc75 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/samples/java/com/azure/messaging/servicebus/ListSessionsAsyncSample.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/samples/java/com/azure/messaging/servicebus/ListSessionsAsyncSample.java @@ -8,6 +8,7 @@ import java.time.OffsetDateTime; import java.time.ZoneOffset; import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; /** * Demonstrates how to asynchronously list sessions using both supported modes. Default listing returns sessions with @@ -59,7 +60,7 @@ public void run() throws InterruptedException { }, countdownLatch::countDown); - countdownLatch.await(); + countdownLatch.await(30, TimeUnit.SECONDS); } finally { sessionReceiver.close(); } diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusSessionReceiverAsyncClientTest.java b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusSessionReceiverAsyncClientTest.java index aa6ee8d8b6d1..9815ecc9d93d 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusSessionReceiverAsyncClientTest.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusSessionReceiverAsyncClientTest.java @@ -401,7 +401,7 @@ private static List fullPage(String prefix) { } /** - * Verifies the no-arg listSessions() drives the broker with the default-listing sentinel and + * Verifies the no-arg listSessions() drives the broker with the default-listing sentinel and * collects every page until the broker returns a short page (fewer IDs than the requested page * size), which terminates pagination. */ diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/implementation/ManagementChannelTests.java b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/implementation/ManagementChannelTests.java index 17af17b5fc33..85d195a4bdf7 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/implementation/ManagementChannelTests.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/implementation/ManagementChannelTests.java @@ -1116,10 +1116,10 @@ void getMessageSessionsSessionStateUpdatedAfterMode() { } /** - * Verifies getMessageSessions in default listing mode uses the Track 1 default-listing sentinel. + * Verifies getMessageSessions in default listing mode uses the Track 1 default-listing sentinel. * Track 1's {@code SessionBrowser.MAXDATE} is {@code new Date(253402300800000L)} * (10000-01-01T00:00:00Z UTC, 1 ms past 9999-12-31T23:59:59.999Z), which the broker recognizes - * as the mode that lists sessions with active messages or stored session state. + * as the mode that lists sessions with active messages or stored session state. */ @Test void getMessageSessionsDefaultListingMode() { From 98982f7ae049715310f1a7d8c06b80043849bccc Mon Sep 17 00:00:00 2001 From: Eldert Grootenboer Date: Wed, 19 Aug 2026 17:44:08 -0700 Subject: [PATCH 3/6] docs: finalize Service Bus beta changelog --- sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md b/sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md index ed54c3b8d0a0..2024ab787afa 100644 --- a/sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md +++ b/sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 7.18.0-beta.3 (Unreleased) +## 7.18.0-beta.3 (2026-08-19) ### Features Added @@ -8,8 +8,6 @@ - Added `getSqlFilterCount()` and `getCorrelationFilterCount()` to `TopicRuntimeProperties`, exposing the total number of SQL filters and correlation filters across all of a topic's subscriptions. - Added `ServiceBusServiceVersion.V2024_05` and made it the latest version. The administration client now uses `api-version=2024-05` by default, which is required for the topic filter counts above. -### Breaking Changes - ### Bugs Fixed - Fixed `ServiceBusSessionReceiverClient.acceptNextSession()`/`acceptSession()` blocking for the full From eea5e660c3b4a2007bd0a3083412364a50a8dd50 Mon Sep 17 00:00:00 2001 From: Eldert Grootenboer Date: Wed, 19 Aug 2026 17:57:39 -0700 Subject: [PATCH 4/6] docs: update Service Bus beta release date --- sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md b/sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md index 2024ab787afa..269acb484572 100644 --- a/sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md +++ b/sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 7.18.0-beta.3 (2026-08-19) +## 7.18.0-beta.3 (2026-08-21) ### Features Added From c205b4d43651585c4b9a3cb8cfb9d1b868b8b582 Mon Sep 17 00:00:00 2001 From: Eldert Grootenboer Date: Wed, 19 Aug 2026 18:30:00 -0700 Subject: [PATCH 5/6] docs: update Service Bus README release version --- sdk/servicebus/azure-messaging-servicebus/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/servicebus/azure-messaging-servicebus/README.md b/sdk/servicebus/azure-messaging-servicebus/README.md index aedea949ac9e..5205431b53cc 100644 --- a/sdk/servicebus/azure-messaging-servicebus/README.md +++ b/sdk/servicebus/azure-messaging-servicebus/README.md @@ -70,7 +70,7 @@ add the direct dependency to your project as follows. com.azure azure-messaging-servicebus - 7.18.0-beta.2 + 7.18.0-beta.3 ``` [//]: # ({x-version-update-end}) From 61a80bb58dae2e15d7a75837c5227fd9234f1aaa Mon Sep 17 00:00:00 2001 From: Eldert Grootenboer Date: Wed, 19 Aug 2026 21:36:42 -0700 Subject: [PATCH 6/6] docs: keep release prep separate from session samples --- sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md | 4 +++- sdk/servicebus/azure-messaging-servicebus/README.md | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md b/sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md index 269acb484572..ed54c3b8d0a0 100644 --- a/sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md +++ b/sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 7.18.0-beta.3 (2026-08-21) +## 7.18.0-beta.3 (Unreleased) ### Features Added @@ -8,6 +8,8 @@ - Added `getSqlFilterCount()` and `getCorrelationFilterCount()` to `TopicRuntimeProperties`, exposing the total number of SQL filters and correlation filters across all of a topic's subscriptions. - Added `ServiceBusServiceVersion.V2024_05` and made it the latest version. The administration client now uses `api-version=2024-05` by default, which is required for the topic filter counts above. +### Breaking Changes + ### Bugs Fixed - Fixed `ServiceBusSessionReceiverClient.acceptNextSession()`/`acceptSession()` blocking for the full diff --git a/sdk/servicebus/azure-messaging-servicebus/README.md b/sdk/servicebus/azure-messaging-servicebus/README.md index 5205431b53cc..aedea949ac9e 100644 --- a/sdk/servicebus/azure-messaging-servicebus/README.md +++ b/sdk/servicebus/azure-messaging-servicebus/README.md @@ -70,7 +70,7 @@ add the direct dependency to your project as follows. com.azure azure-messaging-servicebus - 7.18.0-beta.3 + 7.18.0-beta.2 ``` [//]: # ({x-version-update-end})