Skip to content

azure-servicebus_7.15.0

Choose a tag to compare

@azure-sdk-automation azure-sdk-automation released this 08 Oct 20:08
5d45654

7.15.0 (2026-10-06)

Features Added

  • Added an opt-in try_timeout client keyword that bounds a single attempt rather than the whole operation. Applies to sending, management operations (including management-link message settlement), and AMQP link acquisition, where the wait for the link to become ready was previously unbounded. Each attempt gets a fresh try_timeout, still capped by the caller's remaining time; exceeding it raises a retryable OperationTimeoutError and retries. Must be greater than 0 if specified, and defaults to None (off) for other operations; management-link settlement retains a 60-second fallback. It also caps the link acquisition performed by receive_messages() and by receiver iteration, but does not bound the receive_messages() long poll, the iterator's own wait, or receiver-link message settlement. Opening, closing and error-path cleanup of the AMQP handler are bounded on the async client, where a slow call is cancelled once the budget is spent and a cleanup failure never replaces the error that triggered it; the sync client cannot interrupt a blocking call and so detects the overrun only once it returns. Mirrors TryTimeout in the .NET, Java and Go SDKs.

  • Added ServiceBusReceivedMessage.from_bytes() classmethod to construct a ServiceBusReceivedMessage from raw AMQP payload bytes without requiring the deprecated uamqp library. (#43979)

  • Added ServiceBusClient.list_queue_sessions() and ServiceBusClient.list_subscription_sessions() (sync and async) to list session IDs for entities with active messages or stored session state, with optional filtering by session-state update timestamp. The methods return an ItemPaged[str] (AsyncItemPaged[str] on the async client) so callers can iterate every session transparently or page with by_page(). Implements the com.microsoft:get-message-sessions management operation. (#46575)

  • Added sql_filter_count and correlation_filter_count properties to TopicRuntimeProperties, exposing the total number of SQL filters and correlation filters across all of a topic's subscriptions.

  • Added API version 2024-05 and made it the default for the management client, which is required for the topic filter counts above.

Breaking Changes

  • receive_messages() now returns an empty list after 60 seconds when no wait time was given on the call or the receiver; it previously had no deadline and blocked until a message arrived or the connection closed. An explicit max_wait_time still wins, and receiver iteration is unchanged. On a receiver that has not been opened yet, this wait now also bounds the initial link acquisition, including connecting to a NEXT_AVAILABLE_SESSION; open the receiver first (for example with a context manager) to keep that governed solely by the constructor's max_wait_time.

Bugs Fixed

  • Fixed a bug where the async AutoLockRenewer never released completed renewal futures from its internal collection, so a long-lived renewer accumulated one entry per registered message for its whole lifetime (memory growth proportional to the total messages processed, reclaimed only on close()). Each renewal future is now removed as soon as it completes, keeping the collection bounded by the number of active renewals. (#48366)

  • Bounded the nesting depth of AMQP compound types (lists, maps, arrays, and described types) in the pyAMQP decoder to a maximum of 64. A payload nested deeper than that is now rejected early with a ValueError; previously such payloads were bounded only by the Python recursion limit and raised RecursionError.

  • Management, send and receive operations now bound AMQP link acquisition by the caller's timeout, rather than timing only the operation that follows it. Previously a link that never became ready could block indefinitely even when a timeout was supplied. Management and send deduct the time spent from the operation itself, so one attempt shares a single budget.

  • Fixed a bug where messages returned by receive_deferred_messages had a lock_token of None, which prevented settling (completing, abandoning, dead-lettering, deferring) or renewing the lock on a deferred message in PEEK_LOCK mode. The lock token is now read from the lock-token field of the management-link response for deferred messages. (#42454)

  • Read com.microsoft:max-message-batch-size vendor property from the AMQP sender link to correctly limit batch size on Premium large-message entities, where max-message-size can be up to 100 MB but the batch limit is 1 MB.

  • Fixed a bug where sending a batched or multi-message payload with uamqp_transport=True raised TypeError: 'BatchMessage' object is not subscriptable (and a masked AttributeError on the list path) when the first message carried a message_id, session_id, or partition_key. The batch envelope properties are now set through the transport-appropriate code path. (regression from #42598)

  • Fixed a bug where the async receiver factory methods on azure.servicebus.aio.ServiceBusClient (get_queue_receiver, get_subscription_receiver) and the async ServiceBusReceiver annotated the auto_lock_renewer keyword with the synchronous AutoLockRenewer, causing static type checkers to reject the documented azure.servicebus.aio.AutoLockRenewer usage. The annotation now references the async AutoLockRenewer, matching the docstrings and runtime behavior. (#47948)

  • Fixed a bug where closing a PEEK_LOCK receiver did not release messages that had been prefetched into the client buffer or were still in flight, so they remained locked at the broker until lock expiry — delaying their redelivery and inflating their delivery count. On close, a non-session PEEK_LOCK receiver now drains the link (stopping the broker and flushing in-flight transfers) and releases the buffered messages (released disposition), so the broker can redeliver them immediately without incrementing the delivery count. (#42917)

  • Fixed a bug where the async pure-Python AMQP transport failed to connect with [Errno 22] Invalid argument (amqp:socket-error) inside containerized/virtualized environments such as Docker Desktop on macOS. The transport no longer reads back and re-applies platform-negotiated TCP options (e.g. TCP_MAXSEG) that some platforms reject via setsockopt. (#45394)

  • Fixed a bug where passing a fully_qualified_namespace that included a port and/or trailing path (for example the https://<namespace>.servicebus.windows.net:443/ form that Azure returns when provisioning a namespace) raised ServiceBusAuthenticationError. The namespace is now normalized to its bare host, matching the .NET and JavaScript SDKs. (#44034)

  • Fixed a bug where iterating over a ServiceBusReceiver suppressed automatic HTTP instrumentation (e.g. from opentelemetry-instrumentation-httpx/requests) while user code processed a received message, causing the user's own outbound HTTP spans to be dropped. The receive tracing span is now closed before the message is yielded to the caller, so suppression no longer leaks into message processing. (#42755)

  • Fixed a bug in the pyAMQP transport where decoding an incoming performative whose trailing null fields were omitted by the sender (permitted by AMQP 1.0 section 1.4) raised IndexError/TypeError. The decoded field list is now padded to the performative's full field count so omitted trailing fields read back as their AMQP-defined default, including the compact list0 encoding where every field is omitted. A field encoded as an explicit null but whose declared default is non-null (for example a max_frame_size set to null so the connection would compare None < 512) now also reads back as that default.

  • Fixed a bug where PEEK_LOCK settlements on the pure-Python AMQP transport were sent pre-settled even though the receiver link negotiates rcv-settle-mode=second, so the service's terminal outcome (including com.microsoft:message-lock-lost rejections) was discarded and a settlement the service never applied was indistinguishable from success — surfacing only as the message being redelivered at lock expiry. Settlements now wait for the service to confirm the outcome and raise when it is rejected, matching the .NET, Java, JavaScript, and Go SDKs, which all await the disposition unconditionally. This is a behavior change: confirming costs one service round trip per settlement, so settle many messages concurrently rather than one at a time (for example await asyncio.gather(*(receiver.complete_message(m) for m in messages))). Unaffected where outcomes cannot be observed: RECEIVE_AND_DELETE mode and uamqp_transport=True.

  • Fixed management-link message settlement fallback after a receiver link is detached. The pyAMQP transport no longer waits for that broken receiver link before using its independent management links, and both management-link acquisition and request/response have a client-side deadline. Settlement uses the configured try_timeout, or 60 seconds when unset, and keeps retries at the existing outer layer.

Other Changes

  • Clarified in the application_properties documentation (the ServiceBusMessage constructor, the application_properties property, and the README) that when a message is received, its keys and any string values are returned as bytes, not str, along with the recommended bytes-key access and decoding pattern. (#45082)
  • When using the async AmqpOverWebsocket transport on Python 3.10 or later, aiohttp>=3.14.0 is now recommended. Earlier aiohttp versions have a WebSocket heartbeat bug (aio-libs/aiohttp#12030) that can cause the connection to be dropped during long message processing, surfacing as a SocketError ("Cannot write to closing transport"). Python 3.9 users must upgrade Python to install an aiohttp release containing this fix. (#44028)
  • Management operations (peek, deferred receive, message settlement over the management link, lock renewal, session state, session listing, schedule/cancel) now send com.microsoft:server-timeout: the caller's remaining time less one second, or 60 seconds when none was given. Previously no bound was sent, so a stalled service held the call until the AMQP link failed; it now raises a retryable OperationTimeoutError, so a persistently stalled service surfaces after roughly four minutes at default retry settings. Matches the .NET, Java and Go SDKs.
  • Removed the deprecation warning for the legacy uAMQP transport. The uamqp_transport=True option remains available in 7.15.0.