7.0.0 (2020-11-23)
Note: This is the GA release of the
azure-servicebus
package, rolling out the official API surface area constructed over the prior preview releases. Users migrating fromv0.50
are advised to view the migration guide.
New Features
sub_queue
andreceive_mode
may now be passed in as a valid string (as defined by their respective enum type) as well as their enum form when constructingServiceBusReceiver
.- Added support for Distributed Tracing of send, receive, and schedule scenarios.
Breaking Changes
ServiceBusSender
andServiceBusReceiver
are no longer reusable and will raiseValueError
when trying to operate on a closed handler.- Rename
ReceiveMode
toServiceBusReceiveMode
andSubQueue
toServiceBusSubQueue
, and convert their enum values from ints to human-readable strings. - Rename enum values
DeadLetter
toDEAD_LETTER
,TransferDeadLetter
toTRANSFER_DEAD_LETTER
,PeekLock
toPEEK_LOCK
andReceiveAndDelete
toRECEIVE_AND_DELETE
to conform to sdk guidelines going forward. send_messages
,schedule_messages
,cancel_scheduled_messages
andreceive_deferred_messages
now performs a no-op rather than raising aValueError
if provided an empty list of messages or an empty batch.ServiceBusMessage.amqp_annotated_message
has been renamed toServiceBusMessage.raw_amqp_message
to normalize with other SDKs.- Redesigned error hierarchy based on the service-defined error condition:
MessageAlreadySettled
now inherits fromValueError
instead ofServiceBusMessageError
as it's a client-side validation.- Removed
NoActiveSession
which is now replaced byOperationTimeoutError
as the client times out when trying to connect to any available session. - Removed
ServiceBusMessageError
as error condition based exceptions provide comprehensive error information. - Removed
MessageSettleFailed
as error condition based exceptions provide comprehensive error information. - Removed
MessageSendFailed
as error condition based exceptions provide comprehensive error information. - Renamed
MessageContentTooLarge
toMessageSizeExceededError
to be consistent with the term defined by the service. - Renamed
MessageLockExpired
toMessageLockLostError
to be consistent with the term defined by the service. - Renamed
SessionLockExpired
toSessionLockLostError
to be consistent with the term defined by the service. - Introduced
MessageNotFoundError
which would be raised when the requested message was not found. - Introduced
MessagingEntityNotFoundError
which would be raised when a Service Bus resource cannot be found by the Service Bus service. - Introduced
MessagingEntityDisabledError
which would be raised when the Messaging Entity is disabled. - Introduced
MessagingEntityAlreadyExistsError
which would be raised when an entity with the same name exists under the same namespace. - Introduced
ServiceBusQuotaExceededError
which would be raised when a Service Bus resource has been exceeded while interacting with the Azure Service Bus service. - Introduced
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. - Introduced
ServiceBusCommunicationError
which would be raised when there was a general communications error encountered when interacting with the Azure Service Bus service. - Introduced
SessionCannotBeLockedError
which would be raised when the requested session cannot be locked.
- Introduced new client side validation on certain use cases:
ServiceBusMessage
will now raise aTypeError
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.- An improper
receive_mode
value will now raiseValueError
instead ofTypeError
in line with supporting extensible enums. - Setting
ServiceBusMessage.partition_key
to a value different thansession_id
on the message instance now raisesValueError
. ServiceBusClient.get_queue/topic_sender
andServiceBusClient.get_queue/subscription_receiver
will now
raiseValueError
if thequeue_name
ortopic_name
does not match theEntityPath
in the connection string used to construct theServiceBusClient
.- Settling a message that has been peeked will raise
ValueError
. - Settling a message or renewing a lock on a message received in
RECEIVE_AND_DELETE
receive mode will raiseValueError
. - Setting
session_id
,reply_to_session_id
,message_id
andpartition_key
onServiceBusMessage
longer than 128 characters will raiseValueError
.
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 aTrueRuleFilter
rule.- FQDNs and Connection strings are now supported even with strippable whitespace or protocol headers (e.g. 'sb://').
- Using parameter
auto_lock_renewer
on a sessionful receiver alongsideReceiveMode.ReceiveAndDelete
will no longer fail during receipt due to failure to register the message with the renewer.