NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #895 most downloaded on PyPI
Microsoft Azure Service Bus Client Library for Python
Last release 1 months ago
22 Aug 2026
Release timing varies
gaps range from 8 days to 10 months
Nearly every release is documented
notes for 44 of 45 stable releases
Nothing withdrawn
no release was ever pulled
11 years old
62 releases · first in 2015
…raw AMQP payload bytes without requiring the deprecated uamqp library.
ServiceBusReceivedMessage.from_bytes() classmethod to construct a ServiceBusReceivedMessage from raw AMQP payload bytes without requiring the deprecated uamqp library. (#43979)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)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.2024-05 and made it the default for the management client, which is required for the topic filter counts above.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)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.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)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)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)[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)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)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)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.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.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)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)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.One column per quarter.
Code | Docs Support: Active
Code | Docs
Support: Active
Deprecating uamqp_transport in favor of pyAMQP transport. The uamqp_transport will be removed in the next minor release.
uamqp_transport in favor of pyAMQP transport. The uamqp_transport will be removed in the next minor release.Fixed a bug where service errors were incorrectly expected to have info/description fields set in all cases.
Added in emulator support, ServiceBusAdministrationClient is currently not supported by the emulator.
Added ssl_context parameter to the clients to allow users to pass in the SSL context, in which case, connection_verify will be ignored if specified.
ssl_context parameter to the clients to allow users to pass in the SSL context, in which case, connection_verify will be ignored if specified.(#37246)ValueError when using the async client. (37695)Nothing published for this version
Fixed a bug where token refreshes were not happening on long running operations (35717)
ResourceNotFoundError (36545)Fixed a bug where WebsocketConnectionClosedException was not being caught when receiving with AmqpOverWebsocket (34859)
Fixed a bug where the client was not retrying when a connection drop happened (34786)
Updated max_wait_time on the ServiceBusReceiver constructor allowing users to change the default server timeout of 65 seconds when accepting a session
max_wait_time on the ServiceBusReceiver constructor allowing users to change the default server timeout of 65 seconds when accepting a session on a Session-Enabled/Queues/Topics if NEXT_AVAILABLE_SESSION is used.azure-core version to 1.28.0.None values in AMQP connection info with empty strings as per the OpenTelemetry specification (#32190).Fixed a bug where a two character count session id was being incorrectly parsed by azure amqp.
Fixed a bug where prefetch_count was not being passed through correctly and caused messages to not be received as expected when in RECEIVE_AND_DELETE
Fixed the error NoneType object has no attribute 'settle_messages' which was raised when a connection was dropped due to a blocked process
NoneType object has no attribute 'settle_messages' which was raised when a connection was dropped due to a blocked process (#30514)__contains__ method was added to azure.servicebus for the following (PR #30846, thanks @pamelafox).
ServiceBusConnectionStringPropertiesamqp.AmqpMessageHeaderamqp.AmqpMessagePropertiesmanagement.AccessRightsmanagement.NamespacePropertiesmanagement.QueuePropertiesmanagement.TopicPropertiesmanagement.SubscriptionPropertiesmanagement.RulePropertiesFixed the error end frame received on invalid channel which was raised when a disconnect was sent by the service
end frame received on invalid channel which was raised when a disconnect was sent by the service (#30860)link already closed which was raised when the client was closing and disconnecting from the service (#30836)MessageLockLostError from the superclass ServiceBusError.A new float keyword argument socket_timeout has been added to get_queue_sender, get_queue_receiver, get_topic_sender, and get_subscription_receiver on
socket_timeout has been added to get_queue_sender, get_queue_receiver, get_topic_sender, and get_subscription_receiver on the sync and async ServiceBusClient.delivery_id being None.Diagnostic-Id if the traceparent message application property is not found.component attribute was removed from all spans.…the uamqp.Message/uamqp.BatchMessage, has been deprecated.
Version 7.10.0 is our first stable release of the Azure Service Bus client library based on a pure Python implemented AMQP stack.
uamqp_transport has been added to sync and async ServiceBusClient constructors which indicates whether to use the uamqp library or the default pure Python AMQP library as the underlying transport.websocket-client for syncaiohttp for asyncuamqp_transport keyword.ServiceBusAdministrationClient expected credential with get_token method returning AccessToken.token of type bytes and not str, now matching the documentation.raw_amqp_message.header and message.header properties on ServiceReceivedBusMessage were returned with durable, first_acquirer, and priority properties set by default, rather than the values returned by the service.ServiceBusReceivedMessage was not picklable (Issue #27947).message attribute on ServiceBus/ServiceBusMessageBatch/ServiceBusReceivedMessage, which previously exposed the uamqp.Message/uamqp.BatchMessage, has been deprecated.
LegacyMessage/LegacyBatchMessage objects returned by the message attribute on ServiceBus/ServiceBusMessageBatch have been introduced to help facilitate the transition.uamqp >= 1.6.3 as an optional dependency for use with the uamqp_transport keyword.messaging.system - messaging system (i.e., servicebus)messaging.operation - type of operation (i.e., publish, receive, or settle)messaging.batch.message_count - number of messages sent or received (if more than one)ServiceBus.complete)az.namespace, messaging.destination.name, net.peer.name, messaging.system, and messaging.operation attributes.send spans now contain links to message spans. Now, message spans will no longer contain a link to the send span.…the uamqp.Message/uamqp.BatchMessage, has been deprecated.
uamqp_transport has been added to sync and async ServiceBusClient constructors which indicates whether to use the uamqp library or the default pure Python AMQP library as the underlying transport.ServiceBusAdministrationClient expected credential with get_token method returning AccessToken.token of type bytes and not str, now matching the documentation.raw_amqp_message.header and message.header properties on ServiceReceivedBusMessage were returned with durable, first_acquirer, and priority properties set by default, rather than the values returned by the service.message attribute on ServiceBus/ServiceBusMessageBatch/ServiceBusReceivedMessage, which previously exposed the uamqp.Message/uamqp.BatchMessage, has been deprecated.
LegacyMessage/LegacyBatchMessage objects returned by the message attribute on ServiceBus/ServiceBusMessageBatch have been introduced to help facilitate the transition.uamqp >= 1.6.3 as an optional dependency for use with the uamqp_transport keyword.Client side validation of input is now disabled by default for the sync and async ServiceBusAdministrationClient. This means there will be no msrest.e
ServiceBusAdministrationClient. This means there will be no msrest.exceptions.ValidationError raised by the ServiceBusAdministrationClient in the case of malformed input. An azure.core.exceptions.HttpResponseError may now be raised if the server refuses the request.azure.servicebus.management were not following uppercase convention.azure-core version to 1.24.0.msrest dependency.azure-common dependency.Iterator receiving from Service Bus entities has been added back in.
Version 7.9.0a1 is our first efforts to build an Azure Service Bus client library based on a pure Python implemented AMQP stack.
Version 7.9.0a1 is our first efforts to build an Azure Service Bus client library based on a pure Python implemented AMQP stack.
Fixed a bug where asynchronous method to add distributed tracing attributes was not being awaited (Issue #28738).
Fixed a bug that would cause an exception when None was sent to set_state instead of clearing session state (Issue #27582).
None was sent to set_state instead of clearing session state (Issue #27582).This version and all future versions will require Python 3.7+. Python 3.6 is no longer supported.
This version and all future versions will require Python 3.7+. Python 3.6 is no longer supported.
ServiceBusClient where custom_endpoint_address and connection_verify kwargs were not being passed through correctly. (Issue #26015)This version will be the last version to officially support Python 3.6, future versions will require Python 3.7+.
This version will be the last version to officially support Python 3.6, future versions will require Python 3.7+.
ServiceBusClient, get_queue_receiver, get_subscription_receiver, get_queue_sender, and get_topic_sender now accept
an optional client_identifier argument which allows for specifying a custom identifier for the respective sender or receiver. It can
be useful during debugging as Service Bus associates the id with errors and helps with easier correlation.ServiceBusReceiver and ServiceBusSender have an added property client_identifier which returns the client_identifier for the current instance.Fixed bug to make AMQP exceptions retryable by default, if condition is not non-retryable, to ensure that InternalServerErrors are retried.
ServiceBusClient constructor now accepts optional custom_endpoint_address argument
which allows for specifying a custom endpoint to use when communicating with the Service Bus service,
and is useful when your network does not allow communicating to the standard Service Bus endpoint.ServiceBusClientconstructor now accepts optional connection_verify argument
which allows for specifying the path to the custom CA_BUNDLE file of the SSL certificate which is used to authenticate
the identity of the connection endpoint.Improved receiving by releasing messages from internal buffer when the prefetch_count of ServiceBusReceiver is set 0 and there is no active receive ca
prefetch_count of ServiceBusReceiver is set 0 and there is no active receive call, this helps avoid receiving expired messages and incrementing delivery count of a message.Introduce ServiceBusMessageState enum that can assume the values of active, scheduled or deferred.
ServiceBusMessageState enum that can assume the values of active, scheduled or deferred.state property in ServiceBusReceivedMessage.This version and all future versions will require Python 3.6+. Python 2.7 is no longer supported.
This version and all future versions will require Python 3.6+. Python 2.7 is no longer supported.
ServiceBusClient constructors and from_connection_string take retry_mode as a keyword argument.ServiceBusSessionFilter, which is the type of existing NEXT_AVAILABLE_SESSION value.ServiceBusMessage.time_to_live with value being datetime.timedelta, total_seconds should be respected (PR #21869, thanks @jyggen).GA the support to create and update queues and topics of large message size to ServiceBusAdministrationClient. This feature is only available for Serv
ServiceBusAdministrationClient. This feature is only available for Service Bus of Premium Tier.
create_queue, create_topic, update_queue, update_topic on ServiceBusAdministrationClient now take a new keyword argument max_message_size_in_kilobytes.QueueProperties and TopicProperties now have a new instance variable max_message_size_in_kilobytes.ServiceBusAdministrationClient as well as ServiceBusAdministrationClient.from_connection_string now take keyword argument api_version to configure the Service Bus API version. Supported service versions are "2021-05" and "2017-04".azure.servicebus.management.ApiVersion to represent the supported Service Bus API versions.ServiceBusReceiver can not connect to sessionful entity with session id being empty string.ServiceBusMessage.partition_key can not parse empty string properly.Added support to create and update queues and topics of large message size to ServiceBusAdministrationClient. This feature is only available for Servi
ServiceBusAdministrationClient. This feature is only available for Service Bus of Premium Tier.
create_queue, create_topic, update_queue, update_topic on ServiceBusAdministrationClient now take a new keyword argument max_message_size_in_kilobytes.QueueProperties and TopicProperties now have a new instance variable max_message_size_in_kilobytes.Updated uAMQP dependency to 1.4.3.
Improved memory usage of ServiceBusClient to automatically discard spawned ServiceBusSender or ServiceBusReceiver from its handler set when no strong
ServiceBusClient to automatically discard spawned ServiceBusSender or ServiceBusReceiver from its handler set when no strong reference to the sender or receiver exists anymore.azure.servicebus.AutoLockRenewer during lock renewal.Fixed a bug that azure.servicebus.aio.AutoLockRenewer crashes on disposal if no messages have been registered (#19642).
azure.servicebus.aio.AutoLockRenewer crashes on disposal if no messages have been registered (#19642).azure.servicebus.AutoLockRenewer only supports auto lock renewal for max_workers amount of messages/sessions at a time (#19362).Fixed a bug that when setting ServiceBusMessage.partition_key, input value should be not validated against session_id of None (PR #19233, thanks @bish
ServiceBusMessage.partition_key, input value should be not validated against session_id of None (PR #19233, thanks @bishnu-shb).ServiceBusMessage.time_to_live causes OverflowError error on Ubuntu 20.04.AmqpAnnotatedProperties.creation_time and AmqpAnnotatedProperties.absolute_expiry_time should be calculated in the unit of milliseconds instead of seconds.Support for sending AMQP annotated message which allows full access to the AMQP message fields is now GA.
New Features
azure.servicebus.amqp.azure.servicebus.amqp.AmqpMessageHeader and azure.servicebus.amqp.AmqpMessageProperties for accessing amqp header and properties.Breaking Changes from 7.2.0b1
azure.servicebus.AMQPAnnotatedMessage to azure.servicebus.amqp.AmqpAnnotatedMessage.azure.servicebus.AMQPMessageBodyType to azure.servicebus.amqp.AmqpMessageBodyType.AmqpAnnotatedMessage.header returns azure.servicebus.amqp.AmqpMessageHeader instead of uamqp.message.MessageHeader.AmqpAnnotatedMessage.properties returns azure.servicebus.amqp.AmqpMessageProperties instead of uamqp.message.MessageProperties.raw_amqp_message on ServiceBusMessage and ServiceBusReceivedMessage is now a read-only property instead of an instance variable.Bug Fixes
ServiceBusReceiver iterator stops iteration after recovery from connection error (#18795).The preview features related to AMQPAnnotatedMessage introduced in 7.2.0b1 are not included in this version.
The preview features related to AMQPAnnotatedMessage introduced in 7.2.0b1 are not included in this version.
New Features
azure.core.credentials.AzureNamedKeyCredential as credential for authenticating the clients.azure.core.credentials.AzureSasCredential as credential for authenticating the clients is now GA.ServiceBusAdministrationClient.update_* methods now accept keyword arguments to override the properties specified in the model instance.Bug Fixes
update_queue and update_subscription methods were mutating the properties forward_to and forward_dead_lettered_messages_to of the model instance when those properties are entities instead of full paths.repr on ServiceBusMessage and ServiceBusReceivedMessage to show more meaningful text.Notes
Added support for using azure.core.credentials.AzureSasCredential as credential for authenticating the clients.
New Features
azure.core.credentials.AzureSasCredential as credential for authenticating the clients.azure.servicebus.AMQPAnnotatedMessage is now made public and could be instantiated for sending.azure.servicebus.AMQPMessageBodyType to represent the body type of the message message which includes:
DATA: The body of message consists of one or more data sections and each section contains opaque binary data.SEQUENCE: The body of message consists of one or more sequence sections and each section contains an arbitrary number of structured data elements.VALUE: The body of message consists of one amqp-value section and the section contains a single AMQP value.body_type on azure.servicebus.ServiceBusMessage and azure.servicebus.ReceivedMessage which returns azure.servicebus.AMQPMessageBodyType.This version and all future versions will require Python 2.7 or Python 3.6+, Python 3.5 is no longer supported.
This version and all future versions will require Python 2.7 or Python 3.6+, Python 3.5 is no longer supported.
New Features
forward_to and forward_dead_lettered_messages_to parameters in create_queue, update_queue, create_subscription, and update_subscription methods on sync and async ServiceBusAdministrationClient to accept entities as well, rather than only full paths. In the case that an entity is passed in, it is assumed that the entity exists within the same namespace used for constructing the ServiceBusAdministrationClient.Bug Fixes
This version will be the last version to officially support Python 3.5, future versions will require Python 2.7 or Python 3.6+.
This version will be the last version to officially support Python 3.5, future versions will require Python 2.7 or Python 3.6+.
New Features
update_queue, update_topic, update_subscription, and update_rule on ServiceBusAdministrationClient accept Mapping representations of QueueProperties, TopicProperties, SubscriptionProperties, and RuleProperties, respectively.send_messages and schedule_messages on both sync and async versions of ServiceBusSender accept a list of or single instance of Mapping representations of ServiceBusMessage.add_message on ServiceBusMessageBatch now accepts a Mapping representation of ServiceBusMessage.BugFixes
uamqp.errors.LinkForceDetach caused by no activity on the connection for 10 minutes will now be retried internally except for the session receiver case.uamqp.errors.AMQPConnectionError errors with condition code amqp:unknown-error are now categorized into ServiceBusConnectionError instead of the general ServiceBusError.update_* methods on ServiceBusManagementClient will now raise a TypeError rather than an AttributeError in the case of unsupported input type.forward_to and forward_dead_lettered_messages_to will no longer cause authorization errors when used in ServiceBusAdministrationClient for queues and
BugFixes
forward_to and forward_dead_lettered_messages_to will no longer cause authorization errors when used in ServiceBusAdministrationClient for queues and subscriptions (#15543).uamqp.ReceiveClient and uamqp.ReceiveClientAsync receive messages during connection establishment (#15555).> Note: This is the GA release of the azure-servicebus package, rolling out the official API surface area constructed over the prior preview releases.
Note: This is the GA release of the
azure-servicebuspackage, rolling out the official API surface area constructed over the prior preview releases. Users migrating fromv0.50are advised to view the migration guide.
New Features
sub_queue and receive_mode may now be passed in as a valid string (as defined by their respective enum type) as well as their enum form when constructing ServiceBusReceiver.Breaking Changes
ServiceBusSender and ServiceBusReceiver are no longer reusable and will raise ValueError when trying to operate on a closed handler.ReceiveMode to ServiceBusReceiveMode and SubQueue to ServiceBusSubQueue, and convert their enum values from ints to human-readable strings.DeadLetter to DEAD_LETTER, TransferDeadLetter to TRANSFER_DEAD_LETTER, PeekLock to PEEK_LOCK and ReceiveAndDelete to RECEIVE_AND_DELETE to conform to sdk guidelines going forward.send_messages, schedule_messages, cancel_scheduled_messages and receive_deferred_messages now performs a no-op rather than raising a ValueError if provided an empty list of messages or an empty batch.ServiceBusMessage.amqp_annotated_message has been renamed to ServiceBusMessage.raw_amqp_message to normalize with other SDKs.MessageAlreadySettled now inherits from ValueError instead of ServiceBusMessageError as it's a client-side validation.NoActiveSession which is now replaced by OperationTimeoutError as the client times out when trying to connect to any available session.ServiceBusMessageError as error condition based exceptions provide comprehensive error information.MessageSettleFailed as error condition based exceptions provide comprehensive error information.MessageSendFailed as error condition based exceptions provide comprehensive error information.MessageContentTooLarge to MessageSizeExceededError to be consistent with the term defined by the service.MessageLockExpired to MessageLockLostError to be consistent with the term defined by the service.SessionLockExpired to SessionLockLostError to be consistent with the term defined by the service.MessageNotFoundError which would be raised when the requested message was not found.MessagingEntityNotFoundError which would be raised when a Service Bus resource cannot be found by the Service Bus service.MessagingEntityDisabledError which would be raised when the Messaging Entity is disabled.MessagingEntityAlreadyExistsError which would be raised when an entity with the same name exists under the same namespace.ServiceBusQuotaExceededError which would be raised when a Service Bus resource has been exceeded while interacting with the Azure Service Bus service.ServiceBusServerBusyError which would be raised when the Azure Service Bus service reports that it is busy in response to a client request to perform an operation.ServiceBusCommunicationError which would be raised when there was a general communications error encountered when interacting with the Azure Service Bus service.SessionCannotBeLockedError which would be raised when the requested session cannot be locked.ServiceBusMessage will now raise a TypeError when provided an invalid body type. Valid bodies are strings, bytes, and None. Lists are no longer accepted, as they simply concatenated the contents prior.receive_mode value will now raise ValueError instead of TypeError in line with supporting extensible enums.ServiceBusMessage.partition_key to a value different than session_id on the message instance now raises ValueError.ServiceBusClient.get_queue/topic_sender and ServiceBusClient.get_queue/subscription_receiver will now
raise ValueError if the queue_name or topic_name does not match the EntityPath in the connection string used to construct the ServiceBusClient.ValueError.RECEIVE_AND_DELETE receive mode will raise ValueError.session_id, reply_to_session_id, message_id and partition_key on ServiceBusMessage longer than 128 characters will raise ValueError.ServiceBusReceiver.get_streaming_message_iter has been made internal for the time being to assess use patterns before committing to back-compatibility; messages may still be iterated over in equivalent fashion by iterating on the receiver itself.BugFixes
ServiceBusAdministrationClient.create_rule by default now creates a TrueRuleFilter rule.auto_lock_renewer on a sessionful receiver alongside ReceiveMode.ReceiveAndDelete will no longer fail during receipt due to failure to register the message with the renewer.Added support for timeout parameter on the following operations:
New Features
timeout parameter on the following operations:
ServiceBusSender: send_messages, schedule_messages and cancel_scheduled_messagesServiceBusReceiver: receive_deferred_messages, peek_messages and renew_message_lockServiceBusSession: get_state, set_state and renew_lockazure.servicebus.exceptions.ServiceBusError now inherits from azure.core.exceptions.AzureError.parse_connection_string method which parses a connection string into a properties bag containing its component partsauto_lock_renewer parameter on get_queue_receiver and get_subscription_receiver calls to allow auto-registration of messages and sessions for auto-renewal.Breaking Changes
AutoLockRenew to AutoLockRenewer.ServiceBusSessionReceiver which is now unified within class ServiceBusReceiver.
ServiceBusClient.get_queue_session_receiver and ServiceBusClient.get_subscription_session_receiver.ServiceBusClient.get_queue_receiver and ServiceBusClient.get_subscription_receiver now take keyword parameter session_id which must be set when getting a receiver for the sessionful entity.inner_exception that ServiceBusError.__init__ takes is now renamed to error.azure.servicebus.exceptions.MessageError to azure.servicebus.exceptions.ServiceBusMessageErrorazure.servicebus.exceptions.ServiceBusResourceNotFound as azure.core.exceptions.ResourceNotFoundError is now raised when a Service Bus
resource does not exist when using the ServiceBusAdministrationClient.Message to ServiceBusMessage.ReceivedMessage to ServiceBusReceivedMessage.BatchMessage to ServiceBusMessageBatch.
add to add_message on the class.PeekedMessage.ReceivedMessage under module azure.servicebus.aio.ServiceBusSender.create_batch to ServiceBusSender.create_message_batch.MessageSendFailed, MessageSettleFailed and MessageLockExpired
now inherit from azure.servicebus.exceptions.ServiceBusMessageError.get_state in ServiceBusSession now returns bytes instead of a string.ServiceBusReceiver.receive_messages/get_streaming_message_iter and
ServiceBusClient.get_<queue/subscription>_receiver now raises ValueError if the given max_wait_time is less than or equal to 0.ServiceBusMessage to ServiceBusReceiver:
ServiceBusReceiver.complete_message instead of ServiceBusReceivedMessage.complete to complete a message.ServiceBusReceiver.abandon_message instead of ServiceBusReceivedMessage.abandon to abandon a message.ServiceBusReceiver.defer_message instead of ServiceBusReceivedMessage.defer to defer a message.ServiceBusReceiver.dead_letter_message instead of ServiceBusReceivedMessage.dead_letter to dead letter a message.complete_message, abandon_message, defer_message and dead_letter_message)
and methods that use amqp management link for request like schedule_messages, received_deferred_messages, etc.
now raise more concrete exception other than MessageSettleFailed and ServiceBusError.renew_lock method is moved from ServiceBusMessage to ServiceBusReceiver:
ServiceBusReceivedMessage.renew_lock to ServiceBusReceiver.renew_message_lockAutoLockRenewer.register now takes ServiceBusReceiver as a positional parameter.encoding support from ServiceBusMessage.ServiceBusMessage.amqp_message has been renamed to ServiceBusMessage.amqp_annotated_message for cross-sdk consistency.name parameters in ServiceBusAdministrationClient are now precisely specified ala queue_name or rule_nameServiceBusMessage.via_partition_key is no longer exposed, this is pending a full implementation of transactions as it has no external use. If needed, the underlying value can still be accessed in ServiceBusMessage.amqp_annotated_message.annotations.ServiceBusMessage.properties has been renamed to ServiceBusMessage.application_properties for consistency with service verbiage.ServiceBusSender and ServiceBusReceiver) from_connection_string initializers have been made internal until needed. Clients should be initialized from root ServiceBusClient.ServiceBusMessage.label has been renamed to ServiceBusMessage.subject.ServiceBusMessage.amqp_annotated_message has had its type renamed from AMQPMessage to AMQPAnnotatedMessageAutoLockRenewer timeout parameter is renamed to max_lock_renew_durationReceiveAndDelete mode, or configure auto-autorenewal on a ReceiveAndDelete receiver, will raise a ValueError.max_message_count on ServiceBusReceiver.receive_messages is now 1 instead of None and will raise ValueError if the given value is less than or equal to 0.BugFixes
footer and delivery_annotation were not encoded into the outgoing payload.Passing any type other than ReceiveMode as parameter receive_mode now throws a TypeError instead of AttributeError.
Breaking Changes
ReceiveMode as parameter receive_mode now throws a TypeError instead of AttributeError.<Entity>Descriptions as well to reduce ambiguity in which entity was being acted on. TypeError will now be thrown on improper parameter types (non-string).AMQPMessage (Message.amqp_message) properties are now read-only, changes of these properties would not be reflected in the underlying message. This may be subject to change before GA.renew_lock() now returns the UTC datetime that the lock is set to expire at.
New Features
renew_lock() now returns the UTC datetime that the lock is set to expire at.receive_deferred_messages() can now take a single sequence number as well as a list of sequence numbers.from_connection_string methods now support using the SharedAccessSignature key in leiu of sharedaccesskey and sharedaccesskeyname, taking the string of the properly constructed token as value.Message.amqp_messageBreaking Changes
prefetch to prefetch_count.ReceiveSettleMode enum to ReceiveMode, and respectively the mode parameter to receive_mode.retry_total, retry_backoff_factor and retry_backoff_max are now defined at the ServiceBusClient level and inherited by senders and receivers created from it.NEXT_AVAILABLE in azure.servicebus module. A null session_id will suffice.message_count to max_message_count as fewer messages may be present for method peek_messages() and receive_messages().PeekMessage to PeekedMessage.get_session_state() and set_session_state() to get_state() and set_state() accordingly.description to error_description for method dead_letter().created_time and modified_time to created_at_utc and modified_at_utc within AuthorizationRule and NamespaceProperties.requires_preprocessing from SqlRuleFilter and SqlRuleAction.namespace_type from NamespaceProperties.ServiceBusManagementClient to ServiceBusAdministrationClientsend_messages on something not a Message, BatchMessage, or list of Messages, will now throw a TypeError instead of ValueErrorServiceBusClient.close() now closes spawned senders and receivers.queue_name) will result in an AuthenticationErroris_anonymous_accessible from management entities.support_ordering from create_queue and QueuePropertiesenable_subscription_partitioning from create_topic and TopicPropertiesget_dead_letter_[queue,subscription]_receiver() has been removed. To connect to a dead letter queue, utilize the sub_queue parameter of get_[queue,subscription]_receiver() provided with a value from the SubQueue enumServiceBusSharedKeyCredentialentity_availability_status to availability_statusAdded new properties to Message, PeekMessage and ReceivedMessage: content_type, correlation_id, label, message_id, reply_to, reply_to_session_id and t
New Features
content_type, correlation_id, label,
message_id, reply_to, reply_to_session_id and to. Please refer to the docstring for further information.enqueued_sequence_number, dead_letter_error_description,
dead_letter_reason, dead_letter_source, delivery_count and expires_at_utc. Please refer to the docstring for further information.ServiceBusSender.send_messages.on_lock_renew_failure as a parameter to AutoLockRenew.register, taking a callback for when the lock is lost non-intentially (e.g. not via settling, shutdown, or autolockrenew duration completion).CorrelationFilter.properties.parameters and requires_preprocessing to SqlRuleFilter and SqlRuleAction.get_streaming_message_iter() such that max_wait_time can be specified as an override.Breaking Changes
user_properties to properties
properties which represents the AMQP properties now becomes an internal instance variable _amqp_properties.enqueue_sequence_number.annotations.header.partition_id on both type.settled on both type.received_timestamp_utc on both type.settled on PeekMessage.expired on ReceivedMessage.AutoLockRenew.sleep_time and AutoLockRenew.renew_period have been made internal as _sleep_time and _renew_period respectively, as it is not expected a user will have to interact with them.AutoLockRenew.shutdown is now AutoLockRenew.close to normalize with other equivalent behaviors.QueueDescription, TopicDescription, SubscriptionDescription and RuleDescription to QueueProperties, TopicProperties, SubscriptionProperties, and RuleProperties.QueueRuntimeInfo, TopicRuntimeInfo, and SubscriptionRuntimeInfo to QueueRuntimeProperties, TopicRuntimeProperties, and SubscriptionRuntimeProperties.queue from create_queue, topic from create_topic, subscription from create_subscription and rule from create_rule
of ServiceBusManagementClient. Added param name to them and keyword arguments for queue properties, topic properties, subscription properties and rule properties.update_queue and update_topic of ServiceBusManagementClient. This is to encourage utilizing the model class instance instead as returned from a create_*, list_* or get_* operation to ensure it is properly populated. Properties may still be modified.QueueProperties, TopicProperties, SubscriptionProperties and RuleProperties require all arguments to be present for creation. This is to protect against lack of partial updates by requiring all properties to be specified.idle_timeout in get_<queue/subscription>_receiver() to max_wait_time to normalize with naming elsewhere.Added support for management of topics, subscriptions, and rules.
New Features
receive_messages() (formerly receive()) now supports receiving a batch of messages (max_batch_size > 1) without the need to set prefetch parameter during ServiceBusReceiver initialization.BugFixes
AutoLockRenew does not shutdown itself timely.AutoLockRenew does not support context manager.Breaking Changes
receive(), peek() schedule() and send() to receive_messages(), peek_messages(), schedule_messages() and send_messages() to align with other service bus SDKs.receive_messages() (formerly receive()) no longer raises a ValueError if max_batch_size is less than the prefetch parameter set during ServiceBusReceiver initialization.Added support for management of queue entities.
New Features
azure.servicebus.management.ServiceBusManagementClient (azure.servicebus.management.aio.ServiceBusManagementClient for aio) to create, update, delete, list queues and get settings as well as runtime information of queues under a ServiceBus namespace.get_queue_deadletter_receiver and get_subscription_deadletter_receiver in ServiceBusClient to get a ServiceBusReceiver for the dead-letter sub-queue of the target entity.BugFixes
Added method get_topic_sender in ServiceBusClient to get a ServiceBusSender for a topic.
New Features
get_topic_sender in ServiceBusClient to get a ServiceBusSender for a topic.get_subscription_receiver in ServiceBusClient to get a ServiceBusReceiver for a subscription under specific topic.ServiceBusSender.schedule(messages, schedule_time_utc) for scheduling messages.ServiceBusSender.cancel_scheduled_messages(sequence_numbers) for scheduled messages cancellation.ServiceBusSender.send() can now send a list of messages in one call, if they fit into a single batch. If they do not fit a ValueError is thrown.BatchMessage.add() and ServiceBusSender.send() would raise MessageContentTooLarge if the content is over-sized.ServiceBusReceiver.receive() raises ValueError if its param max_batch_size is greater than param prefetch of ServiceBusClient.MessageError, MessageContentTooLarge, ServiceBusAuthenticationError.
MessageError: when you send a problematic message, such as an already sent message or an over-sized message.MessageContentTooLarge: when you send an over-sized message. A subclass of ValueError and MessageError.ServiceBusAuthenticationError: on failure to be authenticated by the service.InvalidHandlerState.BugFixes
logging_enable to True in ServiceBusClient.Breaking Changes
get_queue_sesison_receiver and get_subscription_session_receiver. Non session receivers no longer take session_id as a paramter.ServiceBusSender.send() no longer takes a timeout parameter, as it should be redundant with retry options provided when creating the client.azure.servicebus. Import from azure.servicebus.exceptions instead.ServiceBusSender.schedule() has swapped the ordering of parameters schedule_time_utc and messages for better consistency with send() syntax.Version 7.0.0b1 is a preview of our efforts to create a client library that is user friendly and idiomatic to the Python ecosystem. The reasons for mo
Version 7.0.0b1 is a preview of our efforts to create a client library that is user friendly and idiomatic to the Python ecosystem. The reasons for most of the changes in this update can be found in the Azure SDK Design Guidelines for Python. For more information, please visit https://aka.ms/azure-sdk-preview1-python.
New Features
ServiceBusClient.
credential: The credential object used for authentication which implements TokenCredential interface of getting tokens.http_proxy: A dictionary populated with proxy settings.ServiceBusClient and/or the reference documentation for more information.reconnect should no longer be necessary, it is now performed implicitly.open should no longer be necessary, it is now performed implicitly.
close()-ing is still required if a context manager is not used, to avoid leaking connections.Breaking changes
get_queue no longer exists, utilize get_queue_sender/receiver instead.peek and other queue_client functions have moved to their respective sender/receiver.fetch_next to receive.session to session_id to normalize naming when requesting a receiver against a given session.reconnect no longer exists, and is performed implicitly if needed.open no longer exists, and is performed implicitly if needed.debug in ServiceBusClient initializer to logging_enable.service_namespace in ServiceBusClient initializer to fully_qualified_namespace.azure.servicebus.exceptions.ServiceBusErrorazure.servicebus.exceptions.ServiceBusConnectionErrorazure.servicebus.exceptions.ServiceBusResourceNotFoundazure.servicebus.exceptions.ServiceBusAuthorizationErrorazure.servicebus.exceptions.NoActiveSessionazure.servicebus.exceptions.OperationTimeoutErrorazure.servicebus.exceptions.InvalidHandlerStateazure.servicebus.exceptions.AutoLockRenewTimeoutazure.servicebus.exceptions.AutoLockRenewFailedazure.servicebus.exceptions.EventDataSendErrorazure.servicebus.exceptions.MessageSendFailedazure.servicebus.exceptions.MessageLockExpiredazure.servicebus.exceptions.MessageSettleFailedazure.servicebus.exceptions.MessageAlreadySettledazure.servicebus.exceptions.SessionLockExpiredcreate_batch on a Sender, using add() on the batch to add messages, in order to enforce service-side max batch sized limitations.session_id parameter or property, as opposed to on Send or get_sender via session. This is to allow sending a batch of messages destined to varied sessions.receiver.session, to better compartmentalize functionality specific to sessions.
AutoLockRenew against sessions, one would simply pass the inner session object, instead of the receiver itself.Nothing published for this version
Added support for delivery tag lock tokens
New Features
BugFixes
Fixed bug where enqueued_time and scheduled_enqueue_time of message being parsed as local timestamp rather than UTC.
BugFixes
Original HTTP-based API still available under new namespace: azure.servicebus.control_client
Breaking changes
Within the new namespace, the original HTTP-based API from version 0.21.1 remains unchanged (i.e. no additional features or bugfixes) so for those intending to only use HTTP operations - there is no additional benefit in updating at this time.
New Features
asyncio) for send, receive and message handling.This wheel package is now built with the azure wheel extension
This wheel package is now built with the azure wheel extension
str messages are now accepted in Python 3 and will be encoded in 'utf-8' (will not raise TypeError anymore)
New Features
str messages are now accepted in Python 3 and will be encoded in 'utf-8' (will not raise TypeError anymore)broker_properties can now be defined as a dict, and not only a JSON str. datetime, int, float and boolean are converted.send_topic_message_batch operation (takes an iterable of messages)send_queue_message_batch operation (takes an iterable of messages)Bugfixes
News * #547 Add get dead letter path static methods to Python * #513 Add renew lock Bugfixes * #628 Fix custom properties with double quotes
News
Bugfixes
New header in Rest API which breaks the SDK #658 #657
Bugfixes
Create a requests.Session() if the user doesn't pass one in.
News
Initial release of this package, from the split of the azure package. See the azure package release note for 1.0.0 for details and previous history on
Initial release of this package, from the split of the azure package.
See the azure package release note for 1.0.0 for details and previous
history on Service Bus.
Your coding agent can read these notes before it upgrades. Set up the MCP server →