azure-servicebus


Nameazure-servicebus JSON
Version 7.12.2 PyPI version JSON
download
home_pagehttps://github.com/Azure/azure-sdk-for-python
SummaryMicrosoft Azure Service Bus Client Library for Python
upload_time2024-05-08 20:59:38
maintainerNone
docs_urlNone
authorMicrosoft Corporation
requires_python>=3.8
licenseMIT License
keywords azure azure sdk
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            # Azure Service Bus client library for Python

Azure Service Bus is a high performance cloud-managed messaging service for providing real-time and fault-tolerant communication between distributed senders and receivers.

Service Bus provides multiple mechanisms for asynchronous highly reliable communication, such as structured first-in-first-out messaging,
publish/subscribe capabilities, and the ability to easily scale as your needs grow.

Use the Service Bus client library for Python to communicate between applications and services and implement asynchronous messaging patterns.

* Create Service Bus namespaces, queues, topics, and subscriptions, and modify their settings.
* Send and receive messages within your Service Bus channels.
* Utilize message locks, sessions, and dead letter functionality to implement complex messaging patterns.

[Source code](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/servicebus/azure-servicebus/)
| [Package (PyPi)][pypi]
| [Package (Conda)](https://anaconda.org/microsoft/azure-servicebus)
| [API reference documentation][api_docs]
| [Product documentation][product_docs]
| [Samples](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/servicebus/azure-servicebus/samples)
| [Changelog](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/servicebus/azure-servicebus/CHANGELOG.md)

**NOTE**: If you are using version 0.50 or lower and want to migrate to the latest version
of this package please look at our [migration guide to move from Service Bus V0.50 to Service Bus V7][migration_guide].

## Getting started

### Install the package

Install the Azure Service Bus client library for Python with [pip][pip]:

```Bash
pip install azure-servicebus
```

### Prerequisites:
To use this package, you must have:
* Azure subscription - [Create a free account][azure_sub]
* Azure Service Bus - [Namespace and management credentials][service_bus_namespace]
* Python 3.8 or later - [Install Python][python]


If you need an Azure service bus namespace, you can create it via the [Azure Portal][azure_namespace_creation].
If you do not wish to use the graphical portal UI, you can use the Azure CLI via [Cloud Shell][cloud_shell_bash], or Azure CLI run locally, to create one with this Azure CLI command:

```Bash
az servicebus namespace create --resource-group <resource-group-name> --name <servicebus-namespace-name> --location <servicebus-namespace-location>
```

### Authenticate the client

Interaction with Service Bus starts with an instance of the `ServiceBusClient` class. You either need a **connection string with SAS key**, or a **namespace** and one of its **account keys** to instantiate the client object.
Please find the samples linked below for demonstration as to how to authenticate via either approach.

#### [Create client from connection string][sample_authenticate_client_connstr]

- To obtain the required credentials, one can use the [Azure CLI][azure_cli] snippet (Formatted for Bash Shell) at the top of the linked sample to populate an environment variable with the service bus connection string (you can also find these values in the [Azure Portal][azure_portal] by following the step-by-step guide to [Get a service bus connection string][get_servicebus_conn_str]).

#### [Create client using the azure-identity library][sample_authenticate_client_aad]:

- This constructor takes the fully qualified namespace of your Service Bus instance and a credential that implements the
[TokenCredential][token_credential_interface]
protocol. There are implementations of the `TokenCredential` protocol available in the
[azure-identity package][pypi_azure_identity]. The fully qualified namespace is of the format `<yournamespace.servicebus.windows.net>`.
- To use the credential types provided by `azure-identity`, please install the package:
```pip install azure-identity```
- Additionally, to use the async API, you must first install an async transport, such as [`aiohttp`](https://pypi.org/project/aiohttp/):
```pip install aiohttp```
- When using Azure Active Directory, your principal must be assigned a role which allows access to Service Bus, such as the
Azure Service Bus Data Owner role. For more information about using Azure Active Directory authorization with Service Bus,
please refer to [the associated documentation][servicebus_aad_authentication].

>**Note:** client can be initialized without a context manager, but must be manually closed via client.close() to not leak resources.

## Key concepts

Once you've initialized a `ServiceBusClient`, you can interact with the primary resource types within a Service Bus Namespace, of which multiple can exist and on which actual message transmission takes place, the namespace often serving as an application container:

* [Queue][queue_concept]: Allows for Sending and Receiving of message.  Often used for point-to-point communication.

* [Topic][topic_concept]: As opposed to Queues, Topics are better suited to publish/subscribe scenarios.  A topic can be sent to, but requires a subscription, of which there can be multiple in parallel, to consume from.

* [Subscription][subscription_concept]: The mechanism to consume from a Topic.  Each subscription is independent, and receives a copy of each message sent to the topic.  Rules and Filters can be used to tailor which messages are received by a specific subscription.

For more information about these resources, see [What is Azure Service Bus?][service_bus_overview].

To interact with these resources, one should be familiar with the following SDK concepts:

* [ServiceBusClient][client_reference]: This is the object a user should first initialize to connect to a Service Bus Namespace.  To interact with a queue, topic, or subscription, one would spawn a sender or receiver off of this client.

* [ServiceBusSender][sender_reference]: To send messages to a Queue or Topic, one would use the corresponding `get_queue_sender` or `get_topic_sender` method off of a `ServiceBusClient` instance as seen [here](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/servicebus/azure-servicebus/samples/sync_samples/send_queue.py).

* [ServiceBusReceiver][receiver_reference]: To receive messages from a Queue or Subscription, one would use the corresponding `get_queue_receiver` or `get_subscription_receiver` method off of a `ServiceBusClient` instance as seen [here](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/servicebus/azure-servicebus/samples/sync_samples/receive_queue.py).

* [ServiceBusMessage][message_reference]: When sending, this is the type you will construct to contain your payload.  When receiving, this is where you will access the payload.

### Thread safety

We do not guarantee that the ServiceBusClient, ServiceBusSender, and ServiceBusReceiver are thread-safe. We do not recommend reusing these instances across threads. It is up to the running application to use these classes in a thread-safe manner.

## Examples

The following sections provide several code snippets covering some of the most common Service Bus tasks, including:

* [Send messages to a queue](#send-messages-to-a-queue "Send messages to a queue")
* [Receive messages from a queue](#receive-messages-from-a-queue "Receive messages from a queue")
* [Send and receive a message from a session enabled queue](#send-and-receive-a-message-from-a-session-enabled-queue "Send and receive a message from a session enabled queue")
* [Working with topics and subscriptions](#working-with-topics-and-subscriptions "Working with topics and subscriptions")
* [Settle a message after receipt](#settle-a-message-after-receipt "Settle a message after receipt")
* [Automatically renew Message or Session locks](#automatically-renew-message-or-session-locks "Automatically renew Message or Session locks")

To perform management tasks such as creating and deleting queues/topics/subscriptions, please utilize the azure-mgmt-servicebus library, available [here][servicebus_management_repository].

Please find further examples in the [samples](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/servicebus/azure-servicebus/samples) directory demonstrating common Service Bus scenarios such as sending, receiving, session management and message handling.

### Send messages to a queue
> **NOTE:** see reference documentation [here][send_reference].

This example sends single message and array of messages to a queue that is assumed to already exist, created via the Azure portal or az commands.

```python
from azure.servicebus import ServiceBusClient, ServiceBusMessage

import os
connstr = os.environ['SERVICE_BUS_CONNECTION_STR']
queue_name = os.environ['SERVICE_BUS_QUEUE_NAME']

with ServiceBusClient.from_connection_string(connstr) as client:
    with client.get_queue_sender(queue_name) as sender:
        # Sending a single message
        single_message = ServiceBusMessage("Single message")
        sender.send_messages(single_message)

        # Sending a list of messages
        messages = [ServiceBusMessage("First message"), ServiceBusMessage("Second message")]
        sender.send_messages(messages)
```

> **NOTE:** A message may be scheduled for delayed delivery using the `ServiceBusSender.schedule_messages()` method, or by specifying `ServiceBusMessage.scheduled_enqueue_time_utc` before calling `ServiceBusSender.send_messages()`

> For more detail on scheduling and schedule cancellation please see a sample [here](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/servicebus/azure-servicebus/samples/sync_samples/schedule_messages_and_cancellation.py).

### Receive messages from a queue

To receive from a queue, you can either perform an ad-hoc receive via `receiver.receive_messages()` or receive persistently through the receiver itself.

#### [Receive messages from a queue through iterating over ServiceBusReceiver][streaming_receive_reference]

```python
from azure.servicebus import ServiceBusClient

import os
connstr = os.environ['SERVICE_BUS_CONNECTION_STR']
queue_name = os.environ['SERVICE_BUS_QUEUE_NAME']

with ServiceBusClient.from_connection_string(connstr) as client:
    # max_wait_time specifies how long the receiver should wait with no incoming messages before stopping receipt.
    # Default is None; to receive forever.
    with client.get_queue_receiver(queue_name, max_wait_time=30) as receiver:
        for msg in receiver:  # ServiceBusReceiver instance is a generator.
            print(str(msg))
            # If it is desired to halt receiving early, one can break out of the loop here safely.
```

> **NOTE:** Any message received with `receive_mode=PEEK_LOCK` (this is the default, with the alternative RECEIVE_AND_DELETE removing the message from the queue immediately on receipt)
> has a lock that must be renewed via `receiver.renew_message_lock` before it expires if processing would take longer than the lock duration.
> See [AutoLockRenewer](#automatically-renew-message-or-session-locks "Automatically renew Message or Session locks") for a helper to perform this in the background automatically.
> Lock duration is set in Azure on the queue or topic itself.

#### [Receive messages from a queue through ServiceBusReceiver.receive_messages()][receive_reference]

> **NOTE:** `ServiceBusReceiver.receive_messages()` receives a single or constrained list of messages through an ad-hoc method call, as opposed to receiving perpetually from the generator. It always returns a list.

```python
from azure.servicebus import ServiceBusClient

import os
connstr = os.environ['SERVICE_BUS_CONNECTION_STR']
queue_name = os.environ['SERVICE_BUS_QUEUE_NAME']

with ServiceBusClient.from_connection_string(connstr) as client:
    with client.get_queue_receiver(queue_name) as receiver:
        received_message_array = receiver.receive_messages(max_wait_time=10)  # try to receive a single message within 10 seconds
        if received_message_array:
            print(str(received_message_array[0]))

    with client.get_queue_receiver(queue_name) as receiver:
        received_message_array = receiver.receive_messages(max_message_count=5, max_wait_time=10)  # try to receive maximum 5 messages in a batch within 10 seconds
        for message in received_message_array:
            print(str(message))
```

In this example, max_message_count declares the maximum number of messages to attempt receiving before hitting a max_wait_time as specified in seconds.

> **NOTE:** It should also be noted that `ServiceBusReceiver.peek_messages()` is subtly different than receiving, as it does not lock the messages being peeked, and thus they cannot be settled.


### Send and receive a message from a session enabled queue
> **NOTE:** see reference documentation for session [send][session_send_reference] and [receive][session_receive_reference].

Sessions provide first-in-first-out and single-receiver semantics on top of a queue or subscription.  While the actual receive syntax is the same, initialization differs slightly.

```python
from azure.servicebus import ServiceBusClient, ServiceBusMessage

import os
connstr = os.environ['SERVICE_BUS_CONNECTION_STR']
queue_name = os.environ['SERVICE_BUS_SESSION_QUEUE_NAME']
session_id = os.environ['SERVICE_BUS_SESSION_ID']

with ServiceBusClient.from_connection_string(connstr) as client:
    with client.get_queue_sender(queue_name) as sender:
        sender.send_messages(ServiceBusMessage("Session Enabled Message", session_id=session_id))

    # If session_id is null here, will receive from the first available session.
    with client.get_queue_receiver(queue_name, session_id=session_id) as receiver:
        for msg in receiver:
            print(str(msg))
```

> **NOTE**: Messages received from a session do not need their locks renewed like a non-session receiver; instead the lock management occurs at the
> session level with a session lock that may be renewed with `receiver.session.renew_lock()`


### Working with [topics][topic_reference] and [subscriptions][subscription_reference]
> **NOTE:** see reference documentation for [topics][topic_reference] and [subscriptions][subscription_reference].

Topics and subscriptions give an alternative to queues for sending and receiving messages.  See documents [here][topic_concept] for more overarching detail,
and of how these differ from queues.

```python
from azure.servicebus import ServiceBusClient, ServiceBusMessage

import os
connstr = os.environ['SERVICE_BUS_CONNECTION_STR']
topic_name = os.environ['SERVICE_BUS_TOPIC_NAME']
subscription_name = os.environ['SERVICE_BUS_SUBSCRIPTION_NAME']

with ServiceBusClient.from_connection_string(connstr) as client:
    with client.get_topic_sender(topic_name) as sender:
        sender.send_messages(ServiceBusMessage("Data"))

    # If session_id is null here, will receive from the first available session.
    with client.get_subscription_receiver(topic_name, subscription_name) as receiver:
        for msg in receiver:
            print(str(msg))
```

### Settle a message after receipt

When receiving from a queue, you have multiple actions you can take on the messages you receive.

> **NOTE**: You can only settle `ServiceBusReceivedMessage` objects which are received in `ServiceBusReceiveMode.PEEK_LOCK` mode (this is the default).
> `ServiceBusReceiveMode.RECEIVE_AND_DELETE` mode removes the message from the queue on receipt.  `ServiceBusReceivedMessage` messages
> returned from `peek_messages()` cannot be settled, as the message lock is not taken like it is in the aforementioned receive methods.

If the message has a lock as mentioned above, settlement will fail if the message lock has expired.
If processing would take longer than the lock duration, it must be maintained via `receiver.renew_message_lock` before it expires.
Lock duration is set in Azure on the queue or topic itself.
See [AutoLockRenewer](#automatically-renew-message-or-session-locks "Automatically renew Message or Session locks") for a helper to perform this in the background automatically.

#### [Complete][complete_reference]

Declares the message processing to be successfully completed, removing the message from the queue.

```python
from azure.servicebus import ServiceBusClient

import os
connstr = os.environ['SERVICE_BUS_CONNECTION_STR']
queue_name = os.environ['SERVICE_BUS_QUEUE_NAME']

with ServiceBusClient.from_connection_string(connstr) as client:
    with client.get_queue_receiver(queue_name) as receiver:
        for msg in receiver:
            print(str(msg))
            receiver.complete_message(msg)
```

#### [Abandon][abandon_reference]

Abandon processing of the message for the time being, returning the message immediately back to the queue to be picked up by another (or the same) receiver.

```python
from azure.servicebus import ServiceBusClient

import os
connstr = os.environ['SERVICE_BUS_CONNECTION_STR']
queue_name = os.environ['SERVICE_BUS_QUEUE_NAME']

with ServiceBusClient.from_connection_string(connstr) as client:
    with client.get_queue_receiver(queue_name) as receiver:
        for msg in receiver:
            print(str(msg))
            receiver.abandon_message(msg)
```

#### [DeadLetter][deadletter_reference]

Transfer the message from the primary queue into a special "dead-letter sub-queue" where it can be accessed using the `ServiceBusClient.get_<queue|subscription>_receiver` function with parameter `sub_queue=ServiceBusSubQueue.DEAD_LETTER` and consumed from like any other receiver. (see sample [here](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/servicebus/azure-servicebus/samples/sync_samples/receive_deadlettered_messages.py))

```python
from azure.servicebus import ServiceBusClient

import os
connstr = os.environ['SERVICE_BUS_CONNECTION_STR']
queue_name = os.environ['SERVICE_BUS_QUEUE_NAME']

with ServiceBusClient.from_connection_string(connstr) as client:
    with client.get_queue_receiver(queue_name) as receiver:
        for msg in receiver:
            print(str(msg))
            receiver.dead_letter_message(msg)
```

#### [Defer][defer_reference]

Defer is subtly different from the prior settlement methods.  It prevents the message from being directly received from the queue
by setting it aside such that it must be received by sequence number in a call to `ServiceBusReceiver.receive_deferred_messages` (see sample [here](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/servicebus/azure-servicebus/samples/sync_samples/receive_deferred_message_queue.py))

```python
from azure.servicebus import ServiceBusClient

import os
connstr = os.environ['SERVICE_BUS_CONNECTION_STR']
queue_name = os.environ['SERVICE_BUS_QUEUE_NAME']

with ServiceBusClient.from_connection_string(connstr) as client:
    with client.get_queue_receiver(queue_name) as receiver:
        for msg in receiver:
            print(str(msg))
            receiver.defer_message(msg)
```

### Automatically renew Message or Session locks
> **NOTE:** see reference documentation for [auto-lock-renewal][autolockrenew_reference].

`AutoLockRenewer` is a simple method for ensuring your message or session remains locked even over long periods of time, if calling `receiver.renew_message_lock`/`receiver.session.renew_lock` is impractical or undesired.
Internally, it is not much more than shorthand for creating a concurrent watchdog to do lock renewal if the object is nearing expiry.
It should be used as follows:

* Message lock automatic renewing

```python
from azure.servicebus import ServiceBusClient, AutoLockRenewer

import os
connstr = os.environ['SERVICE_BUS_CONNECTION_STR']
queue_name = os.environ['SERVICE_BUS_QUEUE_NAME']

# Can also be called via "with AutoLockRenewer() as renewer" to automate closing.
renewer = AutoLockRenewer()
with ServiceBusClient.from_connection_string(connstr) as client:
    with client.get_queue_receiver(queue_name) as receiver:
        for msg in receiver.receive_messages():
            renewer.register(receiver, msg, max_lock_renewal_duration=60)
            # Do your application logic here
            receiver.complete_message(msg)
renewer.close()
```

* Session lock automatic renewing

```python
from azure.servicebus import ServiceBusClient, AutoLockRenewer

import os
connstr = os.environ['SERVICE_BUS_CONNECTION_STR']
session_queue_name = os.environ['SERVICE_BUS_SESSION_QUEUE_NAME']
session_id = os.environ['SERVICE_BUS_SESSION_ID']

# Can also be called via "with AutoLockRenewer() as renewer" to automate closing.
renewer = AutoLockRenewer()
with ServiceBusClient.from_connection_string(connstr) as client:
    with client.get_queue_receiver(session_queue_name, session_id=session_id) as receiver:
        renewer.register(receiver, receiver.session, max_lock_renewal_duration=300) # Duration for how long to maintain the lock for, in seconds.

        for msg in receiver.receive_messages():
            # Do your application logic here
            receiver.complete_message(msg)
renewer.close()
```

If for any reason auto-renewal has been interrupted or failed, this can be observed via the `auto_renew_error` property on the object being renewed, or by having passed a callback to the `on_lock_renew_failure` parameter on renewer initialization.
It would also manifest when trying to take action (such as completing a message) on the specified object.

## Troubleshooting

### Logging

- Enable `azure.servicebus` logger to collect traces from the library.
- Enable AMQP frame level trace by setting `logging_enable=True` when creating the client.

```python
import logging
import sys

handler = logging.StreamHandler(stream=sys.stdout)
logger = logging.getLogger('azure.servicebus')
logger.setLevel(logging.DEBUG)
logger.addHandler(handler)

...

from azure.servicebus import ServiceBusClient

client = ServiceBusClient(..., logging_enable=True)
```

### Timeouts

There are various timeouts a user should be aware of within the library.
- 10 minute service side link closure:  A link, once opened, will be closed after 10 minutes idle to protect the service against resource leakage.  This should largely
be transparent to a user, but if you notice a reconnect occurring after such a duration, this is why.  Performing any operations, including management operations, on the
link will extend this timeout.
- max_wait_time: Provided on creation of a receiver or when calling `receive_messages()`, the time after which receiving messages will halt after no traffic.  This applies both to the imperative `receive_messages()` function as well as the length
a generator-style receive will run for before exiting if there are no messages.  Passing None (default) will wait forever, up until the 10 minute threshold if no other action is taken.

> **NOTE:** If processing of a message or session is sufficiently long as to cause timeouts, as an alternative to calling `receiver.renew_message_lock`/`receiver.session.renew_lock` manually, one can
> leverage the `AutoLockRenewer` functionality detailed [above](#automatically-renew-message-or-session-locks "Automatically renew Message or Session locks").

### Common Exceptions

The Service Bus APIs generate the following exceptions in azure.servicebus.exceptions:

- **ServiceBusConnectionError:** An error occurred in the connection to the service.
This may have been caused by a transient network issue or service problem. It is recommended to retry.
- **ServiceBusAuthorizationError:** An error occurred when authorizing the connection to the service.
This may have been caused by the credentials not having the right permission to perform the operation.
It is recommended to check the permission of the credentials.
- **ServiceBusAuthenticationError:** An error occurred when authenticate the connection to the service.
This may have been caused by the credentials being incorrect. It is recommended to check the credentials.
- **OperationTimeoutError:** This indicates that the service did not respond to an operation within the expected amount of time.
This may have been caused by a transient network issue or service problem. The service may or may not have successfully completed the request; the status is not known.
It is recommended to attempt to verify the current state and retry if necessary.
- **MessageSizeExceededError:** This indicate that the message content is larger than the service bus frame size.
This could happen when too many service bus messages are sent in a batch or the content passed into
the body of a `Message` is too large. It is recommended to reduce the count of messages being sent in a batch or the size of content being passed into a single `ServiceBusMessage`.
- **MessageAlreadySettled:** This indicates failure to settle the message.
This could happen when trying to settle an already-settled message.
- **MessageLockLostError:** The lock on the message has expired and it has been released back to the queue.
It will need to be received again in order to settle it.
You should be aware of the lock duration of a message and keep renewing the lock before expiration in case of long processing time.
`AutoLockRenewer` could help on keeping the lock of the message automatically renewed.
- **SessionLockLostError:** The lock on the session has expired.
All unsettled messages that have been received can no longer be settled.
It is recommended to reconnect to the session if receive messages again if necessary.
You should be aware of the lock duration of a session and keep renewing the lock before expiration in case of long processing time.
`AutoLockRenewer` could help on keeping the lock of the session automatically renewed.
- **MessageNotFoundError:** Attempt to receive a message with a particular sequence number. This message isn't found.
Make sure the message hasn't been received already. Check the deadletter queue to see if the message has been deadlettered.
- **MessagingEntityNotFoundError:** Entity associated with the operation doesn't exist or it has been deleted.
Please make sure the entity exists.
- **MessagingEntityDisabledError:** Request for a runtime operation on a disabled entity. Please Activate the entity.
- **ServiceBusQuotaExceededError:** The messaging entity has reached its maximum allowable size, or the maximum number of connections to a namespace has been exceeded.
Create space in the entity by receiving messages from the entity or its subqueues.
- **ServiceBusServerBusyError:** Service isn't able to process the request at this time. Client can wait for a period of time, then retry the operation.
- **ServiceBusCommunicationError:** Client isn't able to establish a connection to Service Bus.
Make sure the supplied host name is correct and the host is reachable.
If your code runs in an environment with a firewall/proxy, ensure that the traffic to the Service Bus domain/IP address and ports isn't blocked.
- **SessionCannotBeLockedError:** Attempt to connect to a session with a specific session ID, but the session is currently locked by another client.
Make sure the session is unlocked by other clients.
- **AutoLockRenewFailed:** An attempt to renew a lock on a message or session in the background has failed.
This could happen when the receiver used by `AutoLockRenewer` is closed or the lock of the renewable has expired.
It is recommended to re-register the renewable message or session by receiving the message or connect to the sessionful entity again.
- **AutoLockRenewTimeout:** The time allocated to renew the message or session lock has elapsed. You could re-register the object that wants be auto lock renewed or extend the timeout in advance.
- **ServiceBusError:** All other Service Bus related errors. It is the root error class of all the errors described above.

Please view the [exceptions reference docs][exception_reference] for detailed descriptions of our common Exception types.

## Next steps

### More sample code

Please find further examples in the [samples](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/servicebus/azure-servicebus/samples) directory demonstrating common Service Bus scenarios such as sending, receiving, session management and message handling.

### Additional documentation

For more extensive documentation on the Service Bus service, see the [Service Bus documentation][service_bus_docs] on docs.microsoft.com.

### Management capabilities and documentation

For users seeking to perform management operations against ServiceBus (Creating a queue/topic/etc, altering filter rules, enumerating entities)
please see the [azure-mgmt-servicebus documentation][service_bus_mgmt_docs] for API documentation.  Terse usage examples can be found
[here](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/servicebus/azure-mgmt-servicebus/tests) as well.

### Pure Python AMQP Transport and Backward Compatibility Support

The Azure Service Bus client library is now based on a pure Python AMQP implementation. `uAMQP` has been removed as required dependency.

To use `uAMQP` as the underlying transport:

1. Install `uamqp` with pip.

```
$ pip install uamqp
```

2. Pass `uamqp_transport=True` during client construction.

```python
from azure.servicebus import ServiceBusClient
connection_str = '<< CONNECTION STRING FOR THE SERVICE BUS NAMESPACE >>'
queue_name = '<< NAME OF THE QUEUE >>'
client = ServiceBusClient.from_connection_string(
    connection_str, uamqp_transport=True
)
```

Note: The `message` attribute on `ServiceBusMessage`/`ServiceBusMessageBatch`/`ServiceBusReceivedMessage`, which previously exposed the `uamqp.Message`, has been deprecated.
 The "Legacy" objects returned by `message` attribute have been introduced to help facilitate the transition.

To enable the `uamqp` logger to collect traces from the underlying uAMQP library:
```python
import logging

uamqp_logger = logging.getLogger('uamqp')
uamqp_logger.setLevel(logging.DEBUG)
uamqp_logger.addHandler(handler)

...

from azure.servicebus import ServiceBusClient

client = ServiceBusClient(..., logging_enable=True)
```

There may be cases where you consider the `uamqp` logging to be too verbose. To suppress unnecessary logging, add the following snippet to the top of your code:
```python
import logging

# The logging levels below may need to be changed based on the logging that you want to suppress.
uamqp_logger = logging.getLogger('uamqp')
uamqp_logger.setLevel(logging.ERROR)

# or even further fine-grained control, suppressing the warnings in uamqp.connection module
uamqp_connection_logger = logging.getLogger('uamqp.connection')
uamqp_connection_logger.setLevel(logging.ERROR)
```

### Building uAMQP wheel from source

`azure-servicebus` depends on the [uAMQP](https://pypi.org/project/uamqp/) for the AMQP protocol implementation.
uAMQP wheels are provided for most major operating systems and will be installed automatically when installing `azure-servicebus`.
If [uAMQP](https://pypi.org/project/uamqp/) is intended to be used as the underlying AMQP protocol implementation for `azure-servicebus`,
uAMQP wheels can be found for most major operating systems.

If you're running on a platform for which uAMQP wheels are not provided, please follow
If you intend to use `uAMQP` and you're running on a platform for which uAMQP wheels are not provided, please follow
 the [uAMQP Installation](https://github.com/Azure/azure-uamqp-python#installation) guidance to install from source.

## Contributing

This project welcomes contributions and suggestions.  Most contributions require you to agree to a
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide
a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions
provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.

<!-- LINKS -->
[azure_cli]: https://docs.microsoft.com/cli/azure
[api_docs]: https://docs.microsoft.com/python/api/overview/azure/servicebus-readme
[product_docs]: https://docs.microsoft.com/azure/service-bus-messaging/
[azure_portal]: https://portal.azure.com
[azure_sub]: https://azure.microsoft.com/free/
[cloud_shell]: https://docs.microsoft.com/azure/cloud-shell/overview
[cloud_shell_bash]: https://shell.azure.com/bash
[pip]: https://pypi.org/project/pip/
[pypi]: https://pypi.org/project/azure-servicebus/
[python]: https://www.python.org/downloads/
[venv]: https://docs.python.org/3/library/venv.html
[virtualenv]: https://virtualenv.pypa.io
[service_bus_namespace]: https://docs.microsoft.com/azure/service-bus-messaging/service-bus-create-namespace-portal
[service_bus_overview]: https://docs.microsoft.com/azure/service-bus-messaging/service-bus-messaging-overview
[queue_status_codes]: https://docs.microsoft.com/rest/api/servicebus/create-queue#response-codes
[service_bus_docs]: https://docs.microsoft.com/azure/service-bus/
[service_bus_mgmt_docs]: https://docs.microsoft.com/python/api/azure-mgmt-servicebus/?view=azure-python
[queue_concept]: https://docs.microsoft.com/azure/service-bus-messaging/service-bus-messaging-overview#queues
[topic_concept]: https://docs.microsoft.com/azure/service-bus-messaging/service-bus-messaging-overview#topics
[subscription_concept]: https://docs.microsoft.com/azure/service-bus-messaging/service-bus-queues-topics-subscriptions#topics-and-subscriptions
[azure_namespace_creation]: https://docs.microsoft.com/azure/service-bus-messaging/service-bus-create-namespace-portal
[servicebus_management_repository]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/servicebus/azure-mgmt-servicebus
[get_servicebus_conn_str]: https://docs.microsoft.com/azure/service-bus-messaging/service-bus-create-namespace-portal#get-the-connection-string
[servicebus_aad_authentication]: https://docs.microsoft.com/azure/service-bus-messaging/service-bus-authentication-and-authorization
[token_credential_interface]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/core/azure-core/azure/core/credentials.py
[pypi_azure_identity]: https://pypi.org/project/azure-identity/
[message_reference]: https://azuresdkdocs.blob.core.windows.net/$web/python/azure-servicebus/latest/azure.servicebus.html#azure.servicebus.ServiceBusMessage
[receiver_reference]: https://azuresdkdocs.blob.core.windows.net/$web/python/azure-servicebus/latest/azure.servicebus.html#azure.servicebus.ServiceBusReceiver
[sender_reference]: https://azuresdkdocs.blob.core.windows.net/$web/python/azure-servicebus/latest/azure.servicebus.html#azure.servicebus.ServiceBusSender
[client_reference]: https://azuresdkdocs.blob.core.windows.net/$web/python/azure-servicebus/latest/azure.servicebus.html#azure.servicebus.ServiceBusClient
[send_reference]: https://azuresdkdocs.blob.core.windows.net/$web/python/azure-servicebus/latest/azure.servicebus.html?highlight=send_messages#azure.servicebus.ServiceBusSender.send_messages
[receive_reference]: https://azuresdkdocs.blob.core.windows.net/$web/python/azure-servicebus/latest/azure.servicebus.html?highlight=receive_messages#azure.servicebus.ServiceBusReceiver.receive_messages
[streaming_receive_reference]: https://azuresdkdocs.blob.core.windows.net/$web/python/azure-servicebus/latest/azure.servicebus.html?highlight=next#azure.servicebus.ServiceBusReceiver.next
[session_receive_reference]: https://azuresdkdocs.blob.core.windows.net/$web/python/azure-servicebus/latest/azure.servicebus.html?highlight=session_id#azure.servicebus.ServiceBusSessionReceiver.receive_messages
[session_send_reference]: https://azuresdkdocs.blob.core.windows.net/$web/python/azure-servicebus/latest/azure.servicebus.html?highlight=session_id#azure.servicebus.ServiceBusMessage.session_id
[complete_reference]: https://azuresdkdocs.blob.core.windows.net/$web/python/azure-servicebus/latest/azure.servicebus.html?highlight=complete_message#azure.servicebus.ServiceBusReceiver.complete_message
[abandon_reference]: https://azuresdkdocs.blob.core.windows.net/$web/python/azure-servicebus/latest/azure.servicebus.html?highlight=abandon_message#azure.servicebus.ServiceBusReceiver.abandon_message
[defer_reference]: https://azuresdkdocs.blob.core.windows.net/$web/python/azure-servicebus/latest/azure.servicebus.html?highlight=defer_message#azure.servicebus.ServiceBusReceiver.defer_message
[deadletter_reference]: https://azuresdkdocs.blob.core.windows.net/$web/python/azure-servicebus/latest/azure.servicebus.html?highlight=dead_letter_message#azure.servicebus.ServiceBusReceiver.dead_letter_message
[autolockrenew_reference]: https://azuresdkdocs.blob.core.windows.net/$web/python/azure-servicebus/latest/azure.servicebus.html#azure.servicebus.AutoLockRenewer
[exception_reference]: https://azuresdkdocs.blob.core.windows.net/$web/python/azure-servicebus/latest/azure.servicebus.html#module-azure.servicebus.exceptions
[subscription_reference]: https://azuresdkdocs.blob.core.windows.net/$web/python/azure-servicebus/latest/azure.servicebus.aio.html?highlight=subscription#azure.servicebus.aio.ServiceBusClient.get_subscription_receiver
[topic_reference]: https://azuresdkdocs.blob.core.windows.net/$web/python/azure-servicebus/latest/azure.servicebus.html?highlight=topic#azure.servicebus.ServiceBusClient.get_topic_sender
[sample_authenticate_client_connstr]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/servicebus/azure-servicebus/samples/sync_samples/authenticate_client_connstr.py
[sample_authenticate_client_aad]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/servicebus/azure-servicebus/samples/sync_samples/client_identity_authentication.py
[migration_guide]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/servicebus/azure-servicebus/migration_guide.md


# Release History

## 7.12.2 (2024-05-08)

### Bugs Fixed

- Fixed a bug where WebsocketConnectionClosedException was not being caught when receiving with AmqpOverWebsocket ([34859](https://github.com/Azure/azure-sdk-for-python/pull/34859))
- Fixed incorrect dependency on typing-extensions ([34869](https://github.com/Azure/azure-sdk-for-python/issues/34869), thanks @YaroBear).

## 7.12.1 (2024-03-20)

### Bugs Fixed

- Fixed a bug where the client was not retrying when a connection drop happened ([34786](https://github.com/Azure/azure-sdk-for-python/pull/34786))
- Fixed a bug where the client would not handle a role instance swap on the service correctly ([34820](https://github.com/Azure/azure-sdk-for-python/pull/34820))

### Other Changes

- Updated the logging to more accurately represent when frames are being sent to prevent a client-side idle timeout ([#34793](https://github.com/Azure/azure-sdk-for-python/pull/34793)).

## 7.12.0 (2024-03-06)

### Features Added

- Updated `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.

### Other Changes

- Updated minimum `azure-core` version to 1.28.0.
- Updated Pure Python AMQP network trace logging to replace `None` values in AMQP connection info with empty strings as per the OpenTelemetry specification ([#32190](https://github.com/Azure/azure-sdk-for-python/issues/32190)).
- Updated Pure Python AMQP network trace logging error log on connection close to warning (PR #34504, thanks @RichardOberdieck).

## 7.11.4 (2023-11-13)

### Bugs Fixed

- Fixed a bug where a two character count session id was being incorrectly parsed by azure amqp.

## 7.11.3 (2023-10-11)

### Bugs Fixed

- 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` mode ([#31712](https://github.com/Azure/azure-sdk-for-python/issues/31712), [#31711](https://github.com/Azure/azure-sdk-for-python/issues/31711)).

## 7.11.2 (2023-09-13)

### Bugs Fixed

- Fixed the error `NoneType object has no attribute 'settle_messages'` which was raised when a connection was dropped due to a blocked process ([#30514](https://github.com/Azure/azure-sdk-for-python/issues/30514))

### Other Changes

- The `__contains__` method was added to `azure.servicebus` for the following (PR #30846, thanks @pamelafox).
  - `ServiceBusConnectionStringProperties`
  - `amqp.AmqpMessageHeader`
  - `amqp.AmqpMessageProperties`
  - `management.AccessRights`
  - `management.NamespaceProperties`
  - `management.QueueProperties`
  - `management.TopicProperties`
  - `management.SubscriptionProperties`
  - `management.RuleProperties`

## 7.11.1 (2023-07-12)

### Bugs Fixed

- Fixed the error `end frame received on invalid channel` which was raised when a disconnect was sent by the service ([#30860](https://github.com/Azure/azure-sdk-for-python/pull/30860))
- Fixed the error `link already closed` which was raised when the client was closing and disconnecting from the service ([#30836](https://github.com/Azure/azure-sdk-for-python/pull/30836))

### Other Changes

- The error raised when attempting to complete a message with an expired lock received from a non-sessionful entity has been updated to the more fine-grained `MessageLockLostError` from the superclass `ServiceBusError`.

## 7.11.0 (2023-06-12)

### Features Added

- 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 the sync and async `ServiceBusClient`.

### Bugs Fixed

- Fixed a bug where sending large messages failed on socket write timeout ([#30425](https://github.com/Azure/azure-sdk-for-python/issues/30425)).
- Fixed a bug where settling large messages failed due to  `delivery_id` being `None`.

### Other Changes

- Tracing updates:
  - Span links on receive/send spans now fall back to using `Diagnostic-Id` if the `traceparent` message application property is not found.
  - Span links will now still be created for receive/send spans even if no context propagation headers are found in message application properties.
  - The `component` attribute was removed from all spans.

## 7.10.0 (2023-05-09)

Version 7.10.0 is our first stable release of the Azure Service Bus client library based on a pure Python implemented AMQP stack.

### Features Added

- A new boolean keyword argument `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.

### Breaking Changes

- Added the following as dependencies to be used for operations over websocket:
  - `websocket-client` for sync
  - `aiohttp` for async
- Removed uAMQP from required dependencies and added it as an optional dependency for use with the `uamqp_transport` keyword.

### Bugs Fixed

- Fixed a bug where sync and async `ServiceBusAdministrationClient` expected `credential` with `get_token` method returning `AccessToken.token` of type `bytes` and not `str`, now matching the documentation.
- Fixed a bug where `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.
- Fixed a bug where `ServiceBusReceivedMessage` was not picklable (Issue #27947).

### Other Changes

- The `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.
- Removed uAMQP from required dependencies.
- Adding `uamqp >= 1.6.3` as an optional dependency for use with the `uamqp_transport` keyword.
 - Updated tracing ([#29995](https://github.com/Azure/azure-sdk-for-python/pull/29995)):
   - Additional attributes added to existing spans:
     - `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)
   - A span will now be created upon calls to the service that settle messages.
     - The span name will contain the settlement operation (e.g., `ServiceBus.complete`)
     - The span will contain `az.namespace`, `messaging.destination.name`, `net.peer.name`, `messaging.system`, and `messaging.operation` attributes.
   - All `send` spans now contain links to `message` spans. Now, `message` spans will no longer contain a link to the `send` span.

## 7.10.0b1 (2023-04-13)

### Features Added

- A new boolean keyword argument `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.

### Bugs Fixed

- Fixed a bug where sync and async `ServiceBusAdministrationClient` expected `credential` with `get_token` method returning `AccessToken.token` of type `bytes` and not `str`, now matching the documentation.
- Fixed a bug where `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.

### Other Changes

- The `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.
- Removed uAMQP from required dependencies.
- Adding `uamqp >= 1.6.3` as an optional dependency for use with the `uamqp_transport` keyword.

## 7.9.0 (2023-04-11)

### Breaking Changes

- Client side validation of input is now disabled by default for the sync and async `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.

### Bugs Fixed

- Fixed a bug where enum members in `azure.servicebus.management` were not following uppercase convention.

### Other Changes

- All pure Python AMQP stack related changes have been removed and will be added back in the next version.
- Updated minimum `azure-core` version to 1.24.0.
- Removed `msrest` dependency.
- Removed `azure-common` dependency.

## 7.9.0b1 (2023-03-09)

### Features Added

- Iterator receiving from Service Bus entities has been added back in.

## 7.8.3 (2023-03-09)

### Bugs Fixed

- Fixed a bug where asynchronous method to add distributed tracing attributes was not being awaited (Issue #28738).

## 7.8.2 (2023-01-10)

### Bugs Fixed

- Fixed a bug that would cause an exception when `None` was sent to `set_state` instead of clearing session state (Issue #27582).

### Other Changes

- Updated uAMQP dependency to 1.6.3.
  - Added support for Python 3.11.

## 7.9.0a1 (2022-10-11)

Version 7.9.0a1 is our first efforts to build an Azure Service Bus client library based on a pure Python implemented AMQP stack.

### Breaking Changes

- The following features have been temporarily pulled out which will be added back in future previews as we work towards a stable release:
  - Iterator receiving from Service Bus entities.

### Other Changes

- uAMQP dependency is removed.

## 7.8.1 (2022-10-11)

This version and all future versions will require Python 3.7+. Python 3.6 is no longer supported.

### Bugs Fixed

- Fixed bug on async `ServiceBusClient` where `custom_endpoint_address` and `connection_verify` kwargs were not being passed through correctly. (Issue #26015)

## 7.8.0 (2022-07-06)

This version will be the last version to officially support Python 3.6, future versions will require Python 3.7+.

### Features Added

- In `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.

## 7.7.0 (2022-06-07)

### Bugs Fixed

- Fixed bug to make AMQP exceptions retryable by default, if condition is not non-retryable, to ensure that InternalServerErrors are retried.

### Features Added

- The `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.
- The `ServiceBusClient`constructor 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.

## 7.6.1 (2022-04-11)

### Other Changes

- Improved receiving by releasing messages from internal buffer when the `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.

## 7.6.0 (2022-02-10)

### Features Added

- Introduce `ServiceBusMessageState` enum that can assume the values of `active`, `scheduled` or `deferred`.
- Add `state` property in `ServiceBusReceivedMessage`.

## 7.5.0 (2022-01-12)

This version and all future versions will require Python 3.6+. Python 2.7 is no longer supported.

### Features Added

- Added support for fixed (linear) retry backoff:
  - Sync/async `ServiceBusClient` constructors and `from_connection_string` take `retry_mode` as a keyword argument.
- Added new enum class `ServiceBusSessionFilter`, which is the type of existing `NEXT_AVAILABLE_SESSION` value.

### Bugs Fixed

- Fixed bug that when setting `ServiceBusMessage.time_to_live` with value being `datetime.timedelta`, `total_seconds` should be respected (PR #21869, thanks @jyggen).

### Other Changes

- Improved token refresh timing to prevent potentially blocking main flow when the token is about to get expired soon.
- Updated uAMQP dependency to 1.5.1.

## 7.4.0 (2021-11-09)

### Features Added

- GA the support to create and update queues and topics of large message size to `ServiceBusAdministrationClient`. This feature is only available for Service Bus of Premium Tier.
  - Methods`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`.
- The constructor of`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".
- Added new enum class `azure.servicebus.management.ApiVersion` to represent the supported Service Bus API versions.

### Bugs Fixed

- Fixed bug that `ServiceBusReceiver` can not connect to sessionful entity with session id being empty string.
- Fixed bug that `ServiceBusMessage.partition_key` can not parse empty string properly.

## 7.4.0b1 (2021-10-06)

### Features Added

- Added support to create and update queues and topics of large message size to `ServiceBusAdministrationClient`. This feature is only available for Service Bus of Premium Tier.
  - Methods`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`.

## 7.3.4 (2021-10-06)

### Other Changes

- Updated uAMQP dependency to 1.4.3.
  - Added support for Python 3.10.
  - Fixed memory leak in win32 socketio and tlsio (issue #19777).
  - Fixed memory leak in the process of converting AMQPValue into string (issue #19777).

## 7.3.3 (2021-09-08)

### Bugs Fixed

- Improved memory usage of `ServiceBusClient` to automatically discard spawned `ServiceBusSender` or `ServiceBusReceiver` from its handler set when no strong reference to the sender or receiver exists anymore.
- Reduced CPU load of `azure.servicebus.AutoLockRenewer` during lock renewal.

## 7.3.2 (2021-08-10)

### Bugs Fixed

- Fixed a bug that `azure.servicebus.aio.AutoLockRenewer` crashes on disposal if no messages have been registered (#19642).
- Fixed a bug that `azure.servicebus.AutoLockRenewer` only supports auto lock renewal for `max_workers` amount of messages/sessions at a time (#19362).

## 7.3.1 (2021-07-07)

### Fixed

- Fixed a bug that when setting `ServiceBusMessage.partition_key`, input value should be not validated against `session_id` of None (PR #19233, thanks @bishnu-shb).
- Fixed a bug that setting `ServiceBusMessage.time_to_live` causes OverflowError error on Ubuntu 20.04.
- Fixed a bug that `AmqpAnnotatedProperties.creation_time` and `AmqpAnnotatedProperties.absolute_expiry_time` should be calculated in the unit of milliseconds instead of seconds.
- Updated uAMQP dependency to 1.4.1.
  - Fixed a bug that attributes creation_time, absolute_expiry_time and group_sequence on MessageProperties should be compatible with integer types on Python 2.7.

## 7.3.0 (2021-06-08)

**New Features**

- Support for sending AMQP annotated message which allows full access to the AMQP message fields is now GA.
  - Introduced new namespace `azure.servicebus.amqp`.
  - Introduced new classes `azure.servicebus.amqp.AmqpMessageHeader` and `azure.servicebus.amqp.AmqpMessageProperties` for accessing amqp header and properties.

**Breaking Changes from 7.2.0b1**
  - Renamed and moved `azure.servicebus.AMQPAnnotatedMessage` to `azure.servicebus.amqp.AmqpAnnotatedMessage`.
  - Renamed and moved `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**

* Fixed a bug that `ServiceBusReceiver` iterator stops iteration after recovery from connection error (#18795).

## 7.2.0 (2021-05-13)

The preview features related to AMQPAnnotatedMessage introduced in 7.2.0b1 are not included in this version.

**New Features**

* Added support for using `azure.core.credentials.AzureNamedKeyCredential` as credential for authenticating the clients.
* Support for using `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**

* Fixed a bug where `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.
* Improved the `repr` on `ServiceBusMessage` and `ServiceBusReceivedMessage` to show more meaningful text.
* Updated uAMQP dependency to 1.4.0.
  - Fixed memory leaks in the process of link attach where source and target cython objects are not properly deallocated (#15747).
  - Improved management operation callback not to parse description value of non AMQP_TYPE_STRING type as string (#18361).

**Notes**

* Updated azure-core dependency to 1.14.0.

## 7.2.0b1 (2021-04-07)

**New Features**

* Added support for using `azure.core.credentials.AzureSasCredential` as credential for authenticating the clients.
* Added support for sending AMQP annotated message which allows full access to the AMQP message fields.
  -`azure.servicebus.AMQPAnnotatedMessage` is now made public and could be instantiated for sending.
* Added new enum class `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.
* Added new property `body_type` on `azure.servicebus.ServiceBusMessage` and `azure.servicebus.ReceivedMessage` which returns `azure.servicebus.AMQPMessageBodyType`.

## 7.1.1 (2021-04-07)

This version and all future versions will require Python 2.7 or Python 3.6+, Python 3.5 is no longer supported.

**New Features**

* Updated `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**

* Updated uAMQP dependency to 1.3.0.
  - Fixed bug that sending message of large size triggering segmentation fault when the underlying socket connection is lost (#13739, #14543).
  - Fixed bug in link flow control where link credit and delivery count should be calculated based on per message instead of per transfer frame (#16934).

## 7.1.0 (2021-03-09)

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**

* Updated the following methods so that lists and single instances of Mapping representations are accepted for corresponding strongly-typed object arguments (PR #14807, thanks @bradleydamato):
  - `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**

* Operations failing due to `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`.
* The `update_*` methods on `ServiceBusManagementClient` will now raise a `TypeError` rather than an `AttributeError` in the case of unsupported input type.

## 7.0.1 (2021-01-12)

**BugFixes**

* `forward_to` and `forward_dead_lettered_messages_to` will no longer cause authorization errors when used in `ServiceBusAdministrationClient` for queues and subscriptions (#15543).
* Updated uAMQP dependency to 1.2.13.
  - Fixed bug that macOS was unable to detect network error (#15473).
  - Fixed bug that `uamqp.ReceiveClient` and `uamqp.ReceiveClientAsync` receive messages during connection establishment (#15555).
  - Fixed bug where connection establishment on macOS with Clang 12 triggering unrecognized selector exception (#15567).
  - Fixed bug in accessing message properties triggering segmentation fault when the underlying C bytes are NULL (#15568).

## 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 from `v0.50` are advised to view the [migration guide](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/servicebus/azure-servicebus/migration_guide.md).

**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`.
* Added support for Distributed Tracing of send, receive, and schedule scenarios.

**Breaking Changes**

* `ServiceBusSender` and `ServiceBusReceiver` are no longer reusable and will raise `ValueError` when trying to operate on a closed handler.
* Rename `ReceiveMode` to `ServiceBusReceiveMode` and `SubQueue` to `ServiceBusSubQueue`, and convert their enum values from ints to human-readable strings.
* Rename enum values `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.
* Redesigned error hierarchy based on the service-defined error condition:
  - `MessageAlreadySettled` now inherits from `ValueError` instead of `ServiceBusMessageError` as it's a client-side validation.
  - Removed `NoActiveSession` which is now replaced by `OperationTimeoutError` 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` to `MessageSizeExceededError` to be consistent with the term defined by the service.
  - Renamed `MessageLockExpired` to `MessageLockLostError` to be consistent with the term defined by the service.
  - Renamed `SessionLockExpired` to `SessionLockLostError` 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 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.
  - An improper `receive_mode` value will now raise `ValueError` instead of `TypeError` in line with supporting extensible enums.
  - Setting `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`.
  - 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 raise `ValueError`.
  - Setting `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.
* 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 alongside `ReceiveMode.ReceiveAndDelete` will no longer fail during receipt due to failure to register the message with the renewer.

## 7.0.0b8 (2020-11-05)

**New Features**

* Added support for `timeout` parameter on the following operations:
  - `ServiceBusSender`: `send_messages`, `schedule_messages` and `cancel_scheduled_messages`
  - `ServiceBusReceiver`: `receive_deferred_messages`, `peek_messages` and `renew_message_lock`
  - `ServiceBusSession`: `get_state`, `set_state` and `renew_lock`
* `azure.servicebus.exceptions.ServiceBusError` now inherits from `azure.core.exceptions.AzureError`.
* Added a `parse_connection_string` method which parses a connection string into a properties bag containing its component parts
* Add support for `auto_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**

* Renamed `AutoLockRenew` to `AutoLockRenewer`.
* Removed class `ServiceBusSessionReceiver` which is now unified within class `ServiceBusReceiver`.
  - Removed methods `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.
* The parameter `inner_exception` that `ServiceBusError.__init__` takes is now renamed to `error`.
* Renamed `azure.servicebus.exceptions.MessageError` to `azure.servicebus.exceptions.ServiceBusMessageError`
* Removed error `azure.servicebus.exceptions.ServiceBusResourceNotFound` as `azure.core.exceptions.ResourceNotFoundError` is now raised when a Service Bus
resource does not exist when using the `ServiceBusAdministrationClient`.
* Renamed `Message` to `ServiceBusMessage`.
* Renamed `ReceivedMessage` to `ServiceBusReceivedMessage`.
* Renamed `BatchMessage` to `ServiceBusMessageBatch`.
  - Renamed method `add` to `add_message` on the class.
* Removed class `PeekedMessage`.
* Removed class `ReceivedMessage` under module `azure.servicebus.aio`.
* Renamed `ServiceBusSender.create_batch` to `ServiceBusSender.create_message_batch`.
* Exceptions `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.
* Message settlement methods are moved from `ServiceBusMessage` to `ServiceBusReceiver`:
  - Use `ServiceBusReceiver.complete_message` instead of `ServiceBusReceivedMessage.complete` to complete a message.
  - Use `ServiceBusReceiver.abandon_message` instead of `ServiceBusReceivedMessage.abandon` to abandon a message.
  - Use `ServiceBusReceiver.defer_message` instead of `ServiceBusReceivedMessage.defer` to defer a message.
  - Use `ServiceBusReceiver.dead_letter_message` instead of `ServiceBusReceivedMessage.dead_letter` to dead letter a message.
* Message settlement methods (`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`.
* Message `renew_lock` method is moved from `ServiceBusMessage` to `ServiceBusReceiver`:
  - Changed `ServiceBusReceivedMessage.renew_lock` to `ServiceBusReceiver.renew_message_lock`
* `AutoLockRenewer.register` now takes `ServiceBusReceiver` as a positional parameter.
* Removed `encoding` support from `ServiceBusMessage`.
* `ServiceBusMessage.amqp_message` has been renamed to `ServiceBusMessage.amqp_annotated_message` for cross-sdk consistency.
* All `name` parameters in `ServiceBusAdministrationClient` are now precisely specified ala `queue_name` or `rule_name`
* `ServiceBusMessage.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.
* Sub-client (`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 `AMQPAnnotatedMessage`
* `AutoLockRenewer` `timeout` parameter is renamed to `max_lock_renew_duration`
* Attempting to autorenew a non-renewable message, such as one received in `ReceiveAndDelete` mode, or configure auto-autorenewal on a `ReceiveAndDelete` receiver, will raise a `ValueError`.
* The default value of parameter `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**

* Updated uAMQP dependency to 1.2.12.
  - Added support for Python 3.9.
  - Fixed bug where amqp message `footer` and `delivery_annotation` were not encoded into the outgoing payload.

## 7.0.0b7 (2020-10-05)

**Breaking Changes**

* Passing any type other than `ReceiveMode` as parameter `receive_mode` now throws a `TypeError` instead of `AttributeError`.
* Administration Client calls now take only entity names, not `<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.

## 7.0.0b6 (2020-09-10)

**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.
* Messages can now be sent twice in succession.
* Connection strings used with `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.
* Internal AMQP message properties (header, footer, annotations, properties, etc) are now exposed via `Message.amqp_message`

**Breaking Changes**

* Renamed `prefetch` to `prefetch_count`.
* Renamed `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.
* No longer export `NEXT_AVAILABLE` in `azure.servicebus` module.  A null `session_id` will suffice.
* Renamed parameter `message_count` to `max_message_count` as fewer messages may be present for method `peek_messages()` and `receive_messages()`.
* Renamed `PeekMessage` to `PeekedMessage`.
* Renamed `get_session_state()` and `set_session_state()` to `get_state()` and `set_state()` accordingly.
* Renamed parameter `description` to `error_description` for method `dead_letter()`.
* Renamed properties `created_time` and `modified_time` to `created_at_utc` and `modified_at_utc` within `AuthorizationRule` and `NamespaceProperties`.
* Removed parameter `requires_preprocessing` from `SqlRuleFilter` and `SqlRuleAction`.
* Removed property `namespace_type` from `NamespaceProperties`.
* Rename `ServiceBusManagementClient` to `ServiceBusAdministrationClient`
* Attempting to call `send_messages` on something not a `Message`, `BatchMessage`, or list of `Message`s, will now throw a `TypeError` instead of `ValueError`
* Sending a message twice will no longer result in a MessageAlreadySettled exception.
* `ServiceBusClient.close()` now closes spawned senders and receivers.
* Attempting to initialize a sender or receiver with a different connection string entity and specified entity (e.g. `queue_name`) will result in an AuthenticationError
* Remove `is_anonymous_accessible` from management entities.
* Remove `support_ordering` from `create_queue` and `QueueProperties`
* Remove `enable_subscription_partitioning` from `create_topic` and `TopicProperties`
* `get_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` enum
* No longer export `ServiceBusSharedKeyCredential`
* Rename `entity_availability_status` to `availability_status`

## 7.0.0b5 (2020-08-10)

**New Features**

* Added new properties to Message, PeekMessage and ReceivedMessage: `content_type`, `correlation_id`, `label`,
`message_id`, `reply_to`, `reply_to_session_id` and `to`. Please refer to the docstring for further information.
* Added new properties to PeekMessage and ReceivedMessage: `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.
* Added support for sending received messages via `ServiceBusSender.send_messages`.
* Added `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).
* Added new supported value types int, float, datetime and timedelta for `CorrelationFilter.properties`.
* Added new properties `parameters` and `requires_preprocessing` to `SqlRuleFilter` and `SqlRuleAction`.
* Added an explicit method to fetch the continuous receiving iterator, `get_streaming_message_iter()` such that `max_wait_time` can be specified as an override.

**Breaking Changes**

* Removed/Renamed several properties and instance variables on Message (the changes applied to the inherited Message type PeekMessage and ReceivedMessage).
  - Renamed property `user_properties` to `properties`
      - The original instance variable `properties` which represents the AMQP properties now becomes an internal instance variable `_amqp_properties`.
  - Removed property `enqueue_sequence_number`.
  - Removed property `annotations`.
  - Removed instance variable `header`.
* Removed several properties and instance variables on PeekMessage and ReceivedMessage.
  - Removed property `partition_id` on both type.
  - Removed property `settled` on both type.
  - Removed instance variable `received_timestamp_utc` on both type.
  - Removed property `settled` on `PeekMessage`.
  - Removed property `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.
* Renamed `QueueDescription`, `TopicDescription`, `SubscriptionDescription` and `RuleDescription` to `QueueProperties`, `TopicProperties`, `SubscriptionProperties`, and `RuleProperties`.
* Renamed `QueueRuntimeInfo`, `TopicRuntimeInfo`, and `SubscriptionRuntimeInfo` to `QueueRuntimeProperties`, `TopicRuntimeProperties`, and `SubscriptionRuntimeProperties`.
* Removed param `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.
* Removed model class attributes related keyword arguments from `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.
* Model classes `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.
* Renamed `idle_timeout` in `get_<queue/subscription>_receiver()` to `max_wait_time` to normalize with naming elsewhere.
* Updated uAMQP dependency to 1.2.10 such that the receiver does not shut down when generator times out, and can be received from again.

## 7.0.0b4 (2020-07-06)

**New Features**

* Added support for management of topics, subscriptions, and rules.
* `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**

* Fixed bug where sync `AutoLockRenew` does not shutdown itself timely.
* Fixed bug where async `AutoLockRenew` does not support context manager.

**Breaking Changes**

* Renamed `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.

## 7.0.0b3 (2020-06-08)

**New Features**

* Added support for management of queue entities.
    - Use `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.
* Added methods `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**

* Updated uAMQP dependency to 1.2.8.
    * Fixed bug where reason and description were not being set when dead-lettering messages.

## 7.0.0b2 (2020-05-04)

**New Features**

* Added method `get_topic_sender` in `ServiceBusClient` to get a `ServiceBusSender` for a topic.
* Added method `get_subscription_receiver` in `ServiceBusClient` to get a `ServiceBusReceiver` for a subscription under specific topic.
* Added support for scheduling messages and scheduled message cancellation.
    - Use `ServiceBusSender.schedule(messages, schedule_time_utc)` for scheduling messages.
    - Use `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`.
* Added exception classes `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.
* Removed exception class `InvalidHandlerState`.

**BugFixes**

* Fixed bug where http_proxy and transport_type in ServiceBusClient are not propagated into Sender/Receiver creation properly.
* Updated uAMQP dependency to 1.2.7.
    * Fixed bug in setting certificate of tlsio on MacOS. #7201
    * Fixed bug that caused segmentation fault in network tracing on MacOS when setting `logging_enable` to `True` in `ServiceBusClient`.

**Breaking Changes**

* Session receivers are now created via their own top level functions, e.g. `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.
* Exception imports have been removed from module `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.

## 7.0.0b1 (2020-04-06)

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.
* Note: Not all historical functionality exists in this version at this point.  Topics, Subscriptions, scheduling, dead_letter management and more will be added incrementally over upcoming preview releases.

**New Features**

* Added new configuration parameters when creating `ServiceBusClient`.
    * `credential`: The credential object used for authentication which implements `TokenCredential` interface of getting tokens.
    * `http_proxy`: A dictionary populated with proxy settings.
    * For detailed information about configuration parameters, please see docstring in `ServiceBusClient` and/or the reference documentation for more information.
* Added support for authentication using Azure Identity credentials.
* Added support for retry policy.
* Added support for http proxy.
* Manually calling `reconnect` should no longer be necessary, it is now performed implicitly.
* Manually calling `open` should no longer be necessary, it is now performed implicitly.
    * Note: `close()`-ing is still required if a context manager is not used, to avoid leaking connections.
* Added support for sending a batch of messages destined for heterogenous sessions.

**Breaking changes**

* Simplified API and set of clients
    * `get_queue` no longer exists, utilize `get_queue_sender/receiver` instead.
    * `peek` and other `queue_client` functions have moved to their respective sender/receiver.
    * Renamed `fetch_next` to `receive`.
    * Renamed `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.
* Normalized top level client parameters with idiomatic and consistent naming.
    * Renamed `debug` in `ServiceBusClient` initializer to `logging_enable`.
    * Renamed `service_namespace` in `ServiceBusClient` initializer to `fully_qualified_namespace`.
* New error hierarchy, with more specific semantics
    * `azure.servicebus.exceptions.ServiceBusError`
    * `azure.servicebus.exceptions.ServiceBusConnectionError`
    * `azure.servicebus.exceptions.ServiceBusResourceNotFound`
    * `azure.servicebus.exceptions.ServiceBusAuthorizationError`
    * `azure.servicebus.exceptions.NoActiveSession`
    * `azure.servicebus.exceptions.OperationTimeoutError`
    * `azure.servicebus.exceptions.InvalidHandlerState`
    * `azure.servicebus.exceptions.AutoLockRenewTimeout`
    * `azure.servicebus.exceptions.AutoLockRenewFailed`
    * `azure.servicebus.exceptions.EventDataSendError`
    * `azure.servicebus.exceptions.MessageSendFailed`
    * `azure.servicebus.exceptions.MessageLockExpired`
    * `azure.servicebus.exceptions.MessageSettleFailed`
    * `azure.servicebus.exceptions.MessageAlreadySettled`
    * `azure.servicebus.exceptions.SessionLockExpired`
* BatchMessage creation is now initiated via `create_batch` on a Sender, using `add()` on the batch to add messages, in order to enforce service-side max batch sized limitations.
* Session is now set on the message itself, via `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.
* Session management is now encapsulated within a property of a receiver, e.g. `receiver.session`, to better compartmentalize functionality specific to sessions.
    * To use `AutoLockRenew` against sessions, one would simply pass the inner session object, instead of the receiver itself.

## 0.50.2 (2019-12-09)

**New Features**

* Added support for delivery tag lock tokens

**BugFixes**

* Fixed bug where Message would pass through invalid kwargs on init when attempting to thread through subject.
* Increments UAMQP dependency min version to 1.2.5, to include a set of fixes, including handling of large messages and mitigation of segfaults.

## 0.50.1 (2019-06-24)

**BugFixes**

* Fixed bug where enqueued_time and scheduled_enqueue_time of message being parsed as local timestamp rather than UTC.


## 0.50.0 (2019-01-17)

**Breaking changes**

* Introduces new AMQP-based API.
* Original HTTP-based API still available under new namespace: azure.servicebus.control_client
* For full API changes, please see updated [reference documentation](https://docs.microsoft.com/python/api/azure-servicebus/azure.servicebus?view=azure-python).

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**

* New API supports message send and receive via AMQP with improved performance and stability.
* New asynchronous APIs (using `asyncio`) for send, receive and message handling.
* Support for message and session auto lock renewal via background thread or async operation.
* Now supports scheduled message cancellation.


## 0.21.1 (2017-04-27)

This wheel package is now built with the azure wheel extension

## 0.21.0 (2017-01-13)

**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.
* #902 add `send_topic_message_batch` operation (takes an iterable of messages)
* #902 add `send_queue_message_batch` operation (takes an iterable of messages)

**Bugfixes**

* #820 the code is now more robust to unexpected changes on the SB RestAPI

## 0.20.3 (2016-08-11)

**News**

* #547 Add get dead letter path static methods to Python
* #513 Add renew lock

**Bugfixes**

* #628 Fix custom properties with double quotes

## 0.20.2 (2016-06-28)

**Bugfixes**

* New header in Rest API which breaks the SDK #658 #657

## 0.20.1 (2015-09-14)

**News**

* Create a requests.Session() if the user doesn't pass one in.

## 0.20.0 (2015-08-31)

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.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Azure/azure-sdk-for-python",
    "name": "azure-servicebus",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "azure, azure sdk",
    "author": "Microsoft Corporation",
    "author_email": "azpysdkhelp@microsoft.com",
    "download_url": "https://files.pythonhosted.org/packages/3c/c4/cf0de3625417c0ffa86d7432124cbfc2b4c60d5ed5fb84a81377ffaa35cd/azure-servicebus-7.12.2.tar.gz",
    "platform": null,
    "description": "# Azure Service Bus client library for Python\n\nAzure Service Bus is a high performance cloud-managed messaging service for providing real-time and fault-tolerant communication between distributed senders and receivers.\n\nService Bus provides multiple mechanisms for asynchronous highly reliable communication, such as structured first-in-first-out messaging,\npublish/subscribe capabilities, and the ability to easily scale as your needs grow.\n\nUse the Service Bus client library for Python to communicate between applications and services and implement asynchronous messaging patterns.\n\n* Create Service Bus namespaces, queues, topics, and subscriptions, and modify their settings.\n* Send and receive messages within your Service Bus channels.\n* Utilize message locks, sessions, and dead letter functionality to implement complex messaging patterns.\n\n[Source code](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/servicebus/azure-servicebus/)\n| [Package (PyPi)][pypi]\n| [Package (Conda)](https://anaconda.org/microsoft/azure-servicebus)\n| [API reference documentation][api_docs]\n| [Product documentation][product_docs]\n| [Samples](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/servicebus/azure-servicebus/samples)\n| [Changelog](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/servicebus/azure-servicebus/CHANGELOG.md)\n\n**NOTE**: If you are using version 0.50 or lower and want to migrate to the latest version\nof this package please look at our [migration guide to move from Service Bus V0.50 to Service Bus V7][migration_guide].\n\n## Getting started\n\n### Install the package\n\nInstall the Azure Service Bus client library for Python with [pip][pip]:\n\n```Bash\npip install azure-servicebus\n```\n\n### Prerequisites:\nTo use this package, you must have:\n* Azure subscription - [Create a free account][azure_sub]\n* Azure Service Bus - [Namespace and management credentials][service_bus_namespace]\n* Python 3.8 or later - [Install Python][python]\n\n\nIf you need an Azure service bus namespace, you can create it via the [Azure Portal][azure_namespace_creation].\nIf you do not wish to use the graphical portal UI, you can use the Azure CLI via [Cloud Shell][cloud_shell_bash], or Azure CLI run locally, to create one with this Azure CLI command:\n\n```Bash\naz servicebus namespace create --resource-group <resource-group-name> --name <servicebus-namespace-name> --location <servicebus-namespace-location>\n```\n\n### Authenticate the client\n\nInteraction with Service Bus starts with an instance of the `ServiceBusClient` class. You either need a **connection string with SAS key**, or a **namespace** and one of its **account keys** to instantiate the client object.\nPlease find the samples linked below for demonstration as to how to authenticate via either approach.\n\n#### [Create client from connection string][sample_authenticate_client_connstr]\n\n- To obtain the required credentials, one can use the [Azure CLI][azure_cli] snippet (Formatted for Bash Shell) at the top of the linked sample to populate an environment variable with the service bus connection string (you can also find these values in the [Azure Portal][azure_portal] by following the step-by-step guide to [Get a service bus connection string][get_servicebus_conn_str]).\n\n#### [Create client using the azure-identity library][sample_authenticate_client_aad]:\n\n- This constructor takes the fully qualified namespace of your Service Bus instance and a credential that implements the\n[TokenCredential][token_credential_interface]\nprotocol. There are implementations of the `TokenCredential` protocol available in the\n[azure-identity package][pypi_azure_identity]. The fully qualified namespace is of the format `<yournamespace.servicebus.windows.net>`.\n- To use the credential types provided by `azure-identity`, please install the package:\n```pip install azure-identity```\n- Additionally, to use the async API, you must first install an async transport, such as [`aiohttp`](https://pypi.org/project/aiohttp/):\n```pip install aiohttp```\n- When using Azure Active Directory, your principal must be assigned a role which allows access to Service Bus, such as the\nAzure Service Bus Data Owner role. For more information about using Azure Active Directory authorization with Service Bus,\nplease refer to [the associated documentation][servicebus_aad_authentication].\n\n>**Note:** client can be initialized without a context manager, but must be manually closed via client.close() to not leak resources.\n\n## Key concepts\n\nOnce you've initialized a `ServiceBusClient`, you can interact with the primary resource types within a Service Bus Namespace, of which multiple can exist and on which actual message transmission takes place, the namespace often serving as an application container:\n\n* [Queue][queue_concept]: Allows for Sending and Receiving of message.  Often used for point-to-point communication.\n\n* [Topic][topic_concept]: As opposed to Queues, Topics are better suited to publish/subscribe scenarios.  A topic can be sent to, but requires a subscription, of which there can be multiple in parallel, to consume from.\n\n* [Subscription][subscription_concept]: The mechanism to consume from a Topic.  Each subscription is independent, and receives a copy of each message sent to the topic.  Rules and Filters can be used to tailor which messages are received by a specific subscription.\n\nFor more information about these resources, see [What is Azure Service Bus?][service_bus_overview].\n\nTo interact with these resources, one should be familiar with the following SDK concepts:\n\n* [ServiceBusClient][client_reference]: This is the object a user should first initialize to connect to a Service Bus Namespace.  To interact with a queue, topic, or subscription, one would spawn a sender or receiver off of this client.\n\n* [ServiceBusSender][sender_reference]: To send messages to a Queue or Topic, one would use the corresponding `get_queue_sender` or `get_topic_sender` method off of a `ServiceBusClient` instance as seen [here](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/servicebus/azure-servicebus/samples/sync_samples/send_queue.py).\n\n* [ServiceBusReceiver][receiver_reference]: To receive messages from a Queue or Subscription, one would use the corresponding `get_queue_receiver` or `get_subscription_receiver` method off of a `ServiceBusClient` instance as seen [here](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/servicebus/azure-servicebus/samples/sync_samples/receive_queue.py).\n\n* [ServiceBusMessage][message_reference]: When sending, this is the type you will construct to contain your payload.  When receiving, this is where you will access the payload.\n\n### Thread safety\n\nWe do not guarantee that the ServiceBusClient, ServiceBusSender, and ServiceBusReceiver are thread-safe. We do not recommend reusing these instances across threads. It is up to the running application to use these classes in a thread-safe manner.\n\n## Examples\n\nThe following sections provide several code snippets covering some of the most common Service Bus tasks, including:\n\n* [Send messages to a queue](#send-messages-to-a-queue \"Send messages to a queue\")\n* [Receive messages from a queue](#receive-messages-from-a-queue \"Receive messages from a queue\")\n* [Send and receive a message from a session enabled queue](#send-and-receive-a-message-from-a-session-enabled-queue \"Send and receive a message from a session enabled queue\")\n* [Working with topics and subscriptions](#working-with-topics-and-subscriptions \"Working with topics and subscriptions\")\n* [Settle a message after receipt](#settle-a-message-after-receipt \"Settle a message after receipt\")\n* [Automatically renew Message or Session locks](#automatically-renew-message-or-session-locks \"Automatically renew Message or Session locks\")\n\nTo perform management tasks such as creating and deleting queues/topics/subscriptions, please utilize the azure-mgmt-servicebus library, available [here][servicebus_management_repository].\n\nPlease find further examples in the [samples](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/servicebus/azure-servicebus/samples) directory demonstrating common Service Bus scenarios such as sending, receiving, session management and message handling.\n\n### Send messages to a queue\n> **NOTE:** see reference documentation [here][send_reference].\n\nThis example sends single message and array of messages to a queue that is assumed to already exist, created via the Azure portal or az commands.\n\n```python\nfrom azure.servicebus import ServiceBusClient, ServiceBusMessage\n\nimport os\nconnstr = os.environ['SERVICE_BUS_CONNECTION_STR']\nqueue_name = os.environ['SERVICE_BUS_QUEUE_NAME']\n\nwith ServiceBusClient.from_connection_string(connstr) as client:\n    with client.get_queue_sender(queue_name) as sender:\n        # Sending a single message\n        single_message = ServiceBusMessage(\"Single message\")\n        sender.send_messages(single_message)\n\n        # Sending a list of messages\n        messages = [ServiceBusMessage(\"First message\"), ServiceBusMessage(\"Second message\")]\n        sender.send_messages(messages)\n```\n\n> **NOTE:** A message may be scheduled for delayed delivery using the `ServiceBusSender.schedule_messages()` method, or by specifying `ServiceBusMessage.scheduled_enqueue_time_utc` before calling `ServiceBusSender.send_messages()`\n\n> For more detail on scheduling and schedule cancellation please see a sample [here](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/servicebus/azure-servicebus/samples/sync_samples/schedule_messages_and_cancellation.py).\n\n### Receive messages from a queue\n\nTo receive from a queue, you can either perform an ad-hoc receive via `receiver.receive_messages()` or receive persistently through the receiver itself.\n\n#### [Receive messages from a queue through iterating over ServiceBusReceiver][streaming_receive_reference]\n\n```python\nfrom azure.servicebus import ServiceBusClient\n\nimport os\nconnstr = os.environ['SERVICE_BUS_CONNECTION_STR']\nqueue_name = os.environ['SERVICE_BUS_QUEUE_NAME']\n\nwith ServiceBusClient.from_connection_string(connstr) as client:\n    # max_wait_time specifies how long the receiver should wait with no incoming messages before stopping receipt.\n    # Default is None; to receive forever.\n    with client.get_queue_receiver(queue_name, max_wait_time=30) as receiver:\n        for msg in receiver:  # ServiceBusReceiver instance is a generator.\n            print(str(msg))\n            # If it is desired to halt receiving early, one can break out of the loop here safely.\n```\n\n> **NOTE:** Any message received with `receive_mode=PEEK_LOCK` (this is the default, with the alternative RECEIVE_AND_DELETE removing the message from the queue immediately on receipt)\n> has a lock that must be renewed via `receiver.renew_message_lock` before it expires if processing would take longer than the lock duration.\n> See [AutoLockRenewer](#automatically-renew-message-or-session-locks \"Automatically renew Message or Session locks\") for a helper to perform this in the background automatically.\n> Lock duration is set in Azure on the queue or topic itself.\n\n#### [Receive messages from a queue through ServiceBusReceiver.receive_messages()][receive_reference]\n\n> **NOTE:** `ServiceBusReceiver.receive_messages()` receives a single or constrained list of messages through an ad-hoc method call, as opposed to receiving perpetually from the generator. It always returns a list.\n\n```python\nfrom azure.servicebus import ServiceBusClient\n\nimport os\nconnstr = os.environ['SERVICE_BUS_CONNECTION_STR']\nqueue_name = os.environ['SERVICE_BUS_QUEUE_NAME']\n\nwith ServiceBusClient.from_connection_string(connstr) as client:\n    with client.get_queue_receiver(queue_name) as receiver:\n        received_message_array = receiver.receive_messages(max_wait_time=10)  # try to receive a single message within 10 seconds\n        if received_message_array:\n            print(str(received_message_array[0]))\n\n    with client.get_queue_receiver(queue_name) as receiver:\n        received_message_array = receiver.receive_messages(max_message_count=5, max_wait_time=10)  # try to receive maximum 5 messages in a batch within 10 seconds\n        for message in received_message_array:\n            print(str(message))\n```\n\nIn this example, max_message_count declares the maximum number of messages to attempt receiving before hitting a max_wait_time as specified in seconds.\n\n> **NOTE:** It should also be noted that `ServiceBusReceiver.peek_messages()` is subtly different than receiving, as it does not lock the messages being peeked, and thus they cannot be settled.\n\n\n### Send and receive a message from a session enabled queue\n> **NOTE:** see reference documentation for session [send][session_send_reference] and [receive][session_receive_reference].\n\nSessions provide first-in-first-out and single-receiver semantics on top of a queue or subscription.  While the actual receive syntax is the same, initialization differs slightly.\n\n```python\nfrom azure.servicebus import ServiceBusClient, ServiceBusMessage\n\nimport os\nconnstr = os.environ['SERVICE_BUS_CONNECTION_STR']\nqueue_name = os.environ['SERVICE_BUS_SESSION_QUEUE_NAME']\nsession_id = os.environ['SERVICE_BUS_SESSION_ID']\n\nwith ServiceBusClient.from_connection_string(connstr) as client:\n    with client.get_queue_sender(queue_name) as sender:\n        sender.send_messages(ServiceBusMessage(\"Session Enabled Message\", session_id=session_id))\n\n    # If session_id is null here, will receive from the first available session.\n    with client.get_queue_receiver(queue_name, session_id=session_id) as receiver:\n        for msg in receiver:\n            print(str(msg))\n```\n\n> **NOTE**: Messages received from a session do not need their locks renewed like a non-session receiver; instead the lock management occurs at the\n> session level with a session lock that may be renewed with `receiver.session.renew_lock()`\n\n\n### Working with [topics][topic_reference] and [subscriptions][subscription_reference]\n> **NOTE:** see reference documentation for [topics][topic_reference] and [subscriptions][subscription_reference].\n\nTopics and subscriptions give an alternative to queues for sending and receiving messages.  See documents [here][topic_concept] for more overarching detail,\nand of how these differ from queues.\n\n```python\nfrom azure.servicebus import ServiceBusClient, ServiceBusMessage\n\nimport os\nconnstr = os.environ['SERVICE_BUS_CONNECTION_STR']\ntopic_name = os.environ['SERVICE_BUS_TOPIC_NAME']\nsubscription_name = os.environ['SERVICE_BUS_SUBSCRIPTION_NAME']\n\nwith ServiceBusClient.from_connection_string(connstr) as client:\n    with client.get_topic_sender(topic_name) as sender:\n        sender.send_messages(ServiceBusMessage(\"Data\"))\n\n    # If session_id is null here, will receive from the first available session.\n    with client.get_subscription_receiver(topic_name, subscription_name) as receiver:\n        for msg in receiver:\n            print(str(msg))\n```\n\n### Settle a message after receipt\n\nWhen receiving from a queue, you have multiple actions you can take on the messages you receive.\n\n> **NOTE**: You can only settle `ServiceBusReceivedMessage` objects which are received in `ServiceBusReceiveMode.PEEK_LOCK` mode (this is the default).\n> `ServiceBusReceiveMode.RECEIVE_AND_DELETE` mode removes the message from the queue on receipt.  `ServiceBusReceivedMessage` messages\n> returned from `peek_messages()` cannot be settled, as the message lock is not taken like it is in the aforementioned receive methods.\n\nIf the message has a lock as mentioned above, settlement will fail if the message lock has expired.\nIf processing would take longer than the lock duration, it must be maintained via `receiver.renew_message_lock` before it expires.\nLock duration is set in Azure on the queue or topic itself.\nSee [AutoLockRenewer](#automatically-renew-message-or-session-locks \"Automatically renew Message or Session locks\") for a helper to perform this in the background automatically.\n\n#### [Complete][complete_reference]\n\nDeclares the message processing to be successfully completed, removing the message from the queue.\n\n```python\nfrom azure.servicebus import ServiceBusClient\n\nimport os\nconnstr = os.environ['SERVICE_BUS_CONNECTION_STR']\nqueue_name = os.environ['SERVICE_BUS_QUEUE_NAME']\n\nwith ServiceBusClient.from_connection_string(connstr) as client:\n    with client.get_queue_receiver(queue_name) as receiver:\n        for msg in receiver:\n            print(str(msg))\n            receiver.complete_message(msg)\n```\n\n#### [Abandon][abandon_reference]\n\nAbandon processing of the message for the time being, returning the message immediately back to the queue to be picked up by another (or the same) receiver.\n\n```python\nfrom azure.servicebus import ServiceBusClient\n\nimport os\nconnstr = os.environ['SERVICE_BUS_CONNECTION_STR']\nqueue_name = os.environ['SERVICE_BUS_QUEUE_NAME']\n\nwith ServiceBusClient.from_connection_string(connstr) as client:\n    with client.get_queue_receiver(queue_name) as receiver:\n        for msg in receiver:\n            print(str(msg))\n            receiver.abandon_message(msg)\n```\n\n#### [DeadLetter][deadletter_reference]\n\nTransfer the message from the primary queue into a special \"dead-letter sub-queue\" where it can be accessed using the `ServiceBusClient.get_<queue|subscription>_receiver` function with parameter `sub_queue=ServiceBusSubQueue.DEAD_LETTER` and consumed from like any other receiver. (see sample [here](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/servicebus/azure-servicebus/samples/sync_samples/receive_deadlettered_messages.py))\n\n```python\nfrom azure.servicebus import ServiceBusClient\n\nimport os\nconnstr = os.environ['SERVICE_BUS_CONNECTION_STR']\nqueue_name = os.environ['SERVICE_BUS_QUEUE_NAME']\n\nwith ServiceBusClient.from_connection_string(connstr) as client:\n    with client.get_queue_receiver(queue_name) as receiver:\n        for msg in receiver:\n            print(str(msg))\n            receiver.dead_letter_message(msg)\n```\n\n#### [Defer][defer_reference]\n\nDefer is subtly different from the prior settlement methods.  It prevents the message from being directly received from the queue\nby setting it aside such that it must be received by sequence number in a call to `ServiceBusReceiver.receive_deferred_messages` (see sample [here](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/servicebus/azure-servicebus/samples/sync_samples/receive_deferred_message_queue.py))\n\n```python\nfrom azure.servicebus import ServiceBusClient\n\nimport os\nconnstr = os.environ['SERVICE_BUS_CONNECTION_STR']\nqueue_name = os.environ['SERVICE_BUS_QUEUE_NAME']\n\nwith ServiceBusClient.from_connection_string(connstr) as client:\n    with client.get_queue_receiver(queue_name) as receiver:\n        for msg in receiver:\n            print(str(msg))\n            receiver.defer_message(msg)\n```\n\n### Automatically renew Message or Session locks\n> **NOTE:** see reference documentation for [auto-lock-renewal][autolockrenew_reference].\n\n`AutoLockRenewer` is a simple method for ensuring your message or session remains locked even over long periods of time, if calling `receiver.renew_message_lock`/`receiver.session.renew_lock` is impractical or undesired.\nInternally, it is not much more than shorthand for creating a concurrent watchdog to do lock renewal if the object is nearing expiry.\nIt should be used as follows:\n\n* Message lock automatic renewing\n\n```python\nfrom azure.servicebus import ServiceBusClient, AutoLockRenewer\n\nimport os\nconnstr = os.environ['SERVICE_BUS_CONNECTION_STR']\nqueue_name = os.environ['SERVICE_BUS_QUEUE_NAME']\n\n# Can also be called via \"with AutoLockRenewer() as renewer\" to automate closing.\nrenewer = AutoLockRenewer()\nwith ServiceBusClient.from_connection_string(connstr) as client:\n    with client.get_queue_receiver(queue_name) as receiver:\n        for msg in receiver.receive_messages():\n            renewer.register(receiver, msg, max_lock_renewal_duration=60)\n            # Do your application logic here\n            receiver.complete_message(msg)\nrenewer.close()\n```\n\n* Session lock automatic renewing\n\n```python\nfrom azure.servicebus import ServiceBusClient, AutoLockRenewer\n\nimport os\nconnstr = os.environ['SERVICE_BUS_CONNECTION_STR']\nsession_queue_name = os.environ['SERVICE_BUS_SESSION_QUEUE_NAME']\nsession_id = os.environ['SERVICE_BUS_SESSION_ID']\n\n# Can also be called via \"with AutoLockRenewer() as renewer\" to automate closing.\nrenewer = AutoLockRenewer()\nwith ServiceBusClient.from_connection_string(connstr) as client:\n    with client.get_queue_receiver(session_queue_name, session_id=session_id) as receiver:\n        renewer.register(receiver, receiver.session, max_lock_renewal_duration=300) # Duration for how long to maintain the lock for, in seconds.\n\n        for msg in receiver.receive_messages():\n            # Do your application logic here\n            receiver.complete_message(msg)\nrenewer.close()\n```\n\nIf for any reason auto-renewal has been interrupted or failed, this can be observed via the `auto_renew_error` property on the object being renewed, or by having passed a callback to the `on_lock_renew_failure` parameter on renewer initialization.\nIt would also manifest when trying to take action (such as completing a message) on the specified object.\n\n## Troubleshooting\n\n### Logging\n\n- Enable `azure.servicebus` logger to collect traces from the library.\n- Enable AMQP frame level trace by setting `logging_enable=True` when creating the client.\n\n```python\nimport logging\nimport sys\n\nhandler = logging.StreamHandler(stream=sys.stdout)\nlogger = logging.getLogger('azure.servicebus')\nlogger.setLevel(logging.DEBUG)\nlogger.addHandler(handler)\n\n...\n\nfrom azure.servicebus import ServiceBusClient\n\nclient = ServiceBusClient(..., logging_enable=True)\n```\n\n### Timeouts\n\nThere are various timeouts a user should be aware of within the library.\n- 10 minute service side link closure:  A link, once opened, will be closed after 10 minutes idle to protect the service against resource leakage.  This should largely\nbe transparent to a user, but if you notice a reconnect occurring after such a duration, this is why.  Performing any operations, including management operations, on the\nlink will extend this timeout.\n- max_wait_time: Provided on creation of a receiver or when calling `receive_messages()`, the time after which receiving messages will halt after no traffic.  This applies both to the imperative `receive_messages()` function as well as the length\na generator-style receive will run for before exiting if there are no messages.  Passing None (default) will wait forever, up until the 10 minute threshold if no other action is taken.\n\n> **NOTE:** If processing of a message or session is sufficiently long as to cause timeouts, as an alternative to calling `receiver.renew_message_lock`/`receiver.session.renew_lock` manually, one can\n> leverage the `AutoLockRenewer` functionality detailed [above](#automatically-renew-message-or-session-locks \"Automatically renew Message or Session locks\").\n\n### Common Exceptions\n\nThe Service Bus APIs generate the following exceptions in azure.servicebus.exceptions:\n\n- **ServiceBusConnectionError:** An error occurred in the connection to the service.\nThis may have been caused by a transient network issue or service problem. It is recommended to retry.\n- **ServiceBusAuthorizationError:** An error occurred when authorizing the connection to the service.\nThis may have been caused by the credentials not having the right permission to perform the operation.\nIt is recommended to check the permission of the credentials.\n- **ServiceBusAuthenticationError:** An error occurred when authenticate the connection to the service.\nThis may have been caused by the credentials being incorrect. It is recommended to check the credentials.\n- **OperationTimeoutError:** This indicates that the service did not respond to an operation within the expected amount of time.\nThis may have been caused by a transient network issue or service problem. The service may or may not have successfully completed the request; the status is not known.\nIt is recommended to attempt to verify the current state and retry if necessary.\n- **MessageSizeExceededError:** This indicate that the message content is larger than the service bus frame size.\nThis could happen when too many service bus messages are sent in a batch or the content passed into\nthe body of a `Message` is too large. It is recommended to reduce the count of messages being sent in a batch or the size of content being passed into a single `ServiceBusMessage`.\n- **MessageAlreadySettled:** This indicates failure to settle the message.\nThis could happen when trying to settle an already-settled message.\n- **MessageLockLostError:** The lock on the message has expired and it has been released back to the queue.\nIt will need to be received again in order to settle it.\nYou should be aware of the lock duration of a message and keep renewing the lock before expiration in case of long processing time.\n`AutoLockRenewer` could help on keeping the lock of the message automatically renewed.\n- **SessionLockLostError:** The lock on the session has expired.\nAll unsettled messages that have been received can no longer be settled.\nIt is recommended to reconnect to the session if receive messages again if necessary.\nYou should be aware of the lock duration of a session and keep renewing the lock before expiration in case of long processing time.\n`AutoLockRenewer` could help on keeping the lock of the session automatically renewed.\n- **MessageNotFoundError:** Attempt to receive a message with a particular sequence number. This message isn't found.\nMake sure the message hasn't been received already. Check the deadletter queue to see if the message has been deadlettered.\n- **MessagingEntityNotFoundError:** Entity associated with the operation doesn't exist or it has been deleted.\nPlease make sure the entity exists.\n- **MessagingEntityDisabledError:** Request for a runtime operation on a disabled entity. Please Activate the entity.\n- **ServiceBusQuotaExceededError:** The messaging entity has reached its maximum allowable size, or the maximum number of connections to a namespace has been exceeded.\nCreate space in the entity by receiving messages from the entity or its subqueues.\n- **ServiceBusServerBusyError:** Service isn't able to process the request at this time. Client can wait for a period of time, then retry the operation.\n- **ServiceBusCommunicationError:** Client isn't able to establish a connection to Service Bus.\nMake sure the supplied host name is correct and the host is reachable.\nIf your code runs in an environment with a firewall/proxy, ensure that the traffic to the Service Bus domain/IP address and ports isn't blocked.\n- **SessionCannotBeLockedError:** Attempt to connect to a session with a specific session ID, but the session is currently locked by another client.\nMake sure the session is unlocked by other clients.\n- **AutoLockRenewFailed:** An attempt to renew a lock on a message or session in the background has failed.\nThis could happen when the receiver used by `AutoLockRenewer` is closed or the lock of the renewable has expired.\nIt is recommended to re-register the renewable message or session by receiving the message or connect to the sessionful entity again.\n- **AutoLockRenewTimeout:** The time allocated to renew the message or session lock has elapsed. You could re-register the object that wants be auto lock renewed or extend the timeout in advance.\n- **ServiceBusError:** All other Service Bus related errors. It is the root error class of all the errors described above.\n\nPlease view the [exceptions reference docs][exception_reference] for detailed descriptions of our common Exception types.\n\n## Next steps\n\n### More sample code\n\nPlease find further examples in the [samples](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/servicebus/azure-servicebus/samples) directory demonstrating common Service Bus scenarios such as sending, receiving, session management and message handling.\n\n### Additional documentation\n\nFor more extensive documentation on the Service Bus service, see the [Service Bus documentation][service_bus_docs] on docs.microsoft.com.\n\n### Management capabilities and documentation\n\nFor users seeking to perform management operations against ServiceBus (Creating a queue/topic/etc, altering filter rules, enumerating entities)\nplease see the [azure-mgmt-servicebus documentation][service_bus_mgmt_docs] for API documentation.  Terse usage examples can be found\n[here](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/servicebus/azure-mgmt-servicebus/tests) as well.\n\n### Pure Python AMQP Transport and Backward Compatibility Support\n\nThe Azure Service Bus client library is now based on a pure Python AMQP implementation. `uAMQP` has been removed as required dependency.\n\nTo use `uAMQP` as the underlying transport:\n\n1. Install `uamqp` with pip.\n\n```\n$ pip install uamqp\n```\n\n2. Pass `uamqp_transport=True` during client construction.\n\n```python\nfrom azure.servicebus import ServiceBusClient\nconnection_str = '<< CONNECTION STRING FOR THE SERVICE BUS NAMESPACE >>'\nqueue_name = '<< NAME OF THE QUEUE >>'\nclient = ServiceBusClient.from_connection_string(\n    connection_str, uamqp_transport=True\n)\n```\n\nNote: The `message` attribute on `ServiceBusMessage`/`ServiceBusMessageBatch`/`ServiceBusReceivedMessage`, which previously exposed the `uamqp.Message`, has been deprecated.\n The \"Legacy\" objects returned by `message` attribute have been introduced to help facilitate the transition.\n\nTo enable the `uamqp` logger to collect traces from the underlying uAMQP library:\n```python\nimport logging\n\nuamqp_logger = logging.getLogger('uamqp')\nuamqp_logger.setLevel(logging.DEBUG)\nuamqp_logger.addHandler(handler)\n\n...\n\nfrom azure.servicebus import ServiceBusClient\n\nclient = ServiceBusClient(..., logging_enable=True)\n```\n\nThere may be cases where you consider the `uamqp` logging to be too verbose. To suppress unnecessary logging, add the following snippet to the top of your code:\n```python\nimport logging\n\n# The logging levels below may need to be changed based on the logging that you want to suppress.\nuamqp_logger = logging.getLogger('uamqp')\nuamqp_logger.setLevel(logging.ERROR)\n\n# or even further fine-grained control, suppressing the warnings in uamqp.connection module\nuamqp_connection_logger = logging.getLogger('uamqp.connection')\nuamqp_connection_logger.setLevel(logging.ERROR)\n```\n\n### Building uAMQP wheel from source\n\n`azure-servicebus` depends on the [uAMQP](https://pypi.org/project/uamqp/) for the AMQP protocol implementation.\nuAMQP wheels are provided for most major operating systems and will be installed automatically when installing `azure-servicebus`.\nIf [uAMQP](https://pypi.org/project/uamqp/) is intended to be used as the underlying AMQP protocol implementation for `azure-servicebus`,\nuAMQP wheels can be found for most major operating systems.\n\nIf you're running on a platform for which uAMQP wheels are not provided, please follow\nIf you intend to use `uAMQP` and you're running on a platform for which uAMQP wheels are not provided, please follow\n the [uAMQP Installation](https://github.com/Azure/azure-uamqp-python#installation) guidance to install from source.\n\n## Contributing\n\nThis project welcomes contributions and suggestions.  Most contributions require you to agree to a\nContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us\nthe rights to use your contribution. For details, visit https://cla.microsoft.com.\n\nWhen you submit a pull request, a CLA-bot will automatically determine whether you need to provide\na CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions\nprovided by the bot. You will only need to do this once across all repos using our CLA.\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n\n<!-- LINKS -->\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[api_docs]: https://docs.microsoft.com/python/api/overview/azure/servicebus-readme\n[product_docs]: https://docs.microsoft.com/azure/service-bus-messaging/\n[azure_portal]: https://portal.azure.com\n[azure_sub]: https://azure.microsoft.com/free/\n[cloud_shell]: https://docs.microsoft.com/azure/cloud-shell/overview\n[cloud_shell_bash]: https://shell.azure.com/bash\n[pip]: https://pypi.org/project/pip/\n[pypi]: https://pypi.org/project/azure-servicebus/\n[python]: https://www.python.org/downloads/\n[venv]: https://docs.python.org/3/library/venv.html\n[virtualenv]: https://virtualenv.pypa.io\n[service_bus_namespace]: https://docs.microsoft.com/azure/service-bus-messaging/service-bus-create-namespace-portal\n[service_bus_overview]: https://docs.microsoft.com/azure/service-bus-messaging/service-bus-messaging-overview\n[queue_status_codes]: https://docs.microsoft.com/rest/api/servicebus/create-queue#response-codes\n[service_bus_docs]: https://docs.microsoft.com/azure/service-bus/\n[service_bus_mgmt_docs]: https://docs.microsoft.com/python/api/azure-mgmt-servicebus/?view=azure-python\n[queue_concept]: https://docs.microsoft.com/azure/service-bus-messaging/service-bus-messaging-overview#queues\n[topic_concept]: https://docs.microsoft.com/azure/service-bus-messaging/service-bus-messaging-overview#topics\n[subscription_concept]: https://docs.microsoft.com/azure/service-bus-messaging/service-bus-queues-topics-subscriptions#topics-and-subscriptions\n[azure_namespace_creation]: https://docs.microsoft.com/azure/service-bus-messaging/service-bus-create-namespace-portal\n[servicebus_management_repository]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/servicebus/azure-mgmt-servicebus\n[get_servicebus_conn_str]: https://docs.microsoft.com/azure/service-bus-messaging/service-bus-create-namespace-portal#get-the-connection-string\n[servicebus_aad_authentication]: https://docs.microsoft.com/azure/service-bus-messaging/service-bus-authentication-and-authorization\n[token_credential_interface]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/core/azure-core/azure/core/credentials.py\n[pypi_azure_identity]: https://pypi.org/project/azure-identity/\n[message_reference]: https://azuresdkdocs.blob.core.windows.net/$web/python/azure-servicebus/latest/azure.servicebus.html#azure.servicebus.ServiceBusMessage\n[receiver_reference]: https://azuresdkdocs.blob.core.windows.net/$web/python/azure-servicebus/latest/azure.servicebus.html#azure.servicebus.ServiceBusReceiver\n[sender_reference]: https://azuresdkdocs.blob.core.windows.net/$web/python/azure-servicebus/latest/azure.servicebus.html#azure.servicebus.ServiceBusSender\n[client_reference]: https://azuresdkdocs.blob.core.windows.net/$web/python/azure-servicebus/latest/azure.servicebus.html#azure.servicebus.ServiceBusClient\n[send_reference]: https://azuresdkdocs.blob.core.windows.net/$web/python/azure-servicebus/latest/azure.servicebus.html?highlight=send_messages#azure.servicebus.ServiceBusSender.send_messages\n[receive_reference]: https://azuresdkdocs.blob.core.windows.net/$web/python/azure-servicebus/latest/azure.servicebus.html?highlight=receive_messages#azure.servicebus.ServiceBusReceiver.receive_messages\n[streaming_receive_reference]: https://azuresdkdocs.blob.core.windows.net/$web/python/azure-servicebus/latest/azure.servicebus.html?highlight=next#azure.servicebus.ServiceBusReceiver.next\n[session_receive_reference]: https://azuresdkdocs.blob.core.windows.net/$web/python/azure-servicebus/latest/azure.servicebus.html?highlight=session_id#azure.servicebus.ServiceBusSessionReceiver.receive_messages\n[session_send_reference]: https://azuresdkdocs.blob.core.windows.net/$web/python/azure-servicebus/latest/azure.servicebus.html?highlight=session_id#azure.servicebus.ServiceBusMessage.session_id\n[complete_reference]: https://azuresdkdocs.blob.core.windows.net/$web/python/azure-servicebus/latest/azure.servicebus.html?highlight=complete_message#azure.servicebus.ServiceBusReceiver.complete_message\n[abandon_reference]: https://azuresdkdocs.blob.core.windows.net/$web/python/azure-servicebus/latest/azure.servicebus.html?highlight=abandon_message#azure.servicebus.ServiceBusReceiver.abandon_message\n[defer_reference]: https://azuresdkdocs.blob.core.windows.net/$web/python/azure-servicebus/latest/azure.servicebus.html?highlight=defer_message#azure.servicebus.ServiceBusReceiver.defer_message\n[deadletter_reference]: https://azuresdkdocs.blob.core.windows.net/$web/python/azure-servicebus/latest/azure.servicebus.html?highlight=dead_letter_message#azure.servicebus.ServiceBusReceiver.dead_letter_message\n[autolockrenew_reference]: https://azuresdkdocs.blob.core.windows.net/$web/python/azure-servicebus/latest/azure.servicebus.html#azure.servicebus.AutoLockRenewer\n[exception_reference]: https://azuresdkdocs.blob.core.windows.net/$web/python/azure-servicebus/latest/azure.servicebus.html#module-azure.servicebus.exceptions\n[subscription_reference]: https://azuresdkdocs.blob.core.windows.net/$web/python/azure-servicebus/latest/azure.servicebus.aio.html?highlight=subscription#azure.servicebus.aio.ServiceBusClient.get_subscription_receiver\n[topic_reference]: https://azuresdkdocs.blob.core.windows.net/$web/python/azure-servicebus/latest/azure.servicebus.html?highlight=topic#azure.servicebus.ServiceBusClient.get_topic_sender\n[sample_authenticate_client_connstr]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/servicebus/azure-servicebus/samples/sync_samples/authenticate_client_connstr.py\n[sample_authenticate_client_aad]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/servicebus/azure-servicebus/samples/sync_samples/client_identity_authentication.py\n[migration_guide]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/servicebus/azure-servicebus/migration_guide.md\n\n\n# Release History\n\n## 7.12.2 (2024-05-08)\n\n### Bugs Fixed\n\n- Fixed a bug where WebsocketConnectionClosedException was not being caught when receiving with AmqpOverWebsocket ([34859](https://github.com/Azure/azure-sdk-for-python/pull/34859))\n- Fixed incorrect dependency on typing-extensions ([34869](https://github.com/Azure/azure-sdk-for-python/issues/34869), thanks @YaroBear).\n\n## 7.12.1 (2024-03-20)\n\n### Bugs Fixed\n\n- Fixed a bug where the client was not retrying when a connection drop happened ([34786](https://github.com/Azure/azure-sdk-for-python/pull/34786))\n- Fixed a bug where the client would not handle a role instance swap on the service correctly ([34820](https://github.com/Azure/azure-sdk-for-python/pull/34820))\n\n### Other Changes\n\n- Updated the logging to more accurately represent when frames are being sent to prevent a client-side idle timeout ([#34793](https://github.com/Azure/azure-sdk-for-python/pull/34793)).\n\n## 7.12.0 (2024-03-06)\n\n### Features Added\n\n- Updated `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.\n\n### Other Changes\n\n- Updated minimum `azure-core` version to 1.28.0.\n- Updated Pure Python AMQP network trace logging to replace `None` values in AMQP connection info with empty strings as per the OpenTelemetry specification ([#32190](https://github.com/Azure/azure-sdk-for-python/issues/32190)).\n- Updated Pure Python AMQP network trace logging error log on connection close to warning (PR #34504, thanks @RichardOberdieck).\n\n## 7.11.4 (2023-11-13)\n\n### Bugs Fixed\n\n- Fixed a bug where a two character count session id was being incorrectly parsed by azure amqp.\n\n## 7.11.3 (2023-10-11)\n\n### Bugs Fixed\n\n- 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` mode ([#31712](https://github.com/Azure/azure-sdk-for-python/issues/31712), [#31711](https://github.com/Azure/azure-sdk-for-python/issues/31711)).\n\n## 7.11.2 (2023-09-13)\n\n### Bugs Fixed\n\n- Fixed the error `NoneType object has no attribute 'settle_messages'` which was raised when a connection was dropped due to a blocked process ([#30514](https://github.com/Azure/azure-sdk-for-python/issues/30514))\n\n### Other Changes\n\n- The `__contains__` method was added to `azure.servicebus` for the following (PR #30846, thanks @pamelafox).\n  - `ServiceBusConnectionStringProperties`\n  - `amqp.AmqpMessageHeader`\n  - `amqp.AmqpMessageProperties`\n  - `management.AccessRights`\n  - `management.NamespaceProperties`\n  - `management.QueueProperties`\n  - `management.TopicProperties`\n  - `management.SubscriptionProperties`\n  - `management.RuleProperties`\n\n## 7.11.1 (2023-07-12)\n\n### Bugs Fixed\n\n- Fixed the error `end frame received on invalid channel` which was raised when a disconnect was sent by the service ([#30860](https://github.com/Azure/azure-sdk-for-python/pull/30860))\n- Fixed the error `link already closed` which was raised when the client was closing and disconnecting from the service ([#30836](https://github.com/Azure/azure-sdk-for-python/pull/30836))\n\n### Other Changes\n\n- The error raised when attempting to complete a message with an expired lock received from a non-sessionful entity has been updated to the more fine-grained `MessageLockLostError` from the superclass `ServiceBusError`.\n\n## 7.11.0 (2023-06-12)\n\n### Features Added\n\n- 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 the sync and async `ServiceBusClient`.\n\n### Bugs Fixed\n\n- Fixed a bug where sending large messages failed on socket write timeout ([#30425](https://github.com/Azure/azure-sdk-for-python/issues/30425)).\n- Fixed a bug where settling large messages failed due to  `delivery_id` being `None`.\n\n### Other Changes\n\n- Tracing updates:\n  - Span links on receive/send spans now fall back to using `Diagnostic-Id` if the `traceparent` message application property is not found.\n  - Span links will now still be created for receive/send spans even if no context propagation headers are found in message application properties.\n  - The `component` attribute was removed from all spans.\n\n## 7.10.0 (2023-05-09)\n\nVersion 7.10.0 is our first stable release of the Azure Service Bus client library based on a pure Python implemented AMQP stack.\n\n### Features Added\n\n- A new boolean keyword argument `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.\n\n### Breaking Changes\n\n- Added the following as dependencies to be used for operations over websocket:\n  - `websocket-client` for sync\n  - `aiohttp` for async\n- Removed uAMQP from required dependencies and added it as an optional dependency for use with the `uamqp_transport` keyword.\n\n### Bugs Fixed\n\n- Fixed a bug where sync and async `ServiceBusAdministrationClient` expected `credential` with `get_token` method returning `AccessToken.token` of type `bytes` and not `str`, now matching the documentation.\n- Fixed a bug where `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.\n- Fixed a bug where `ServiceBusReceivedMessage` was not picklable (Issue #27947).\n\n### Other Changes\n\n- The `message` attribute on `ServiceBus`/`ServiceBusMessageBatch`/`ServiceBusReceivedMessage`, which previously exposed the `uamqp.Message`/`uamqp.BatchMessage`, has been deprecated.\n  - `LegacyMessage`/`LegacyBatchMessage` objects returned by the `message` attribute on `ServiceBus`/`ServiceBusMessageBatch` have been introduced to help facilitate the transition.\n- Removed uAMQP from required dependencies.\n- Adding `uamqp >= 1.6.3` as an optional dependency for use with the `uamqp_transport` keyword.\n - Updated tracing ([#29995](https://github.com/Azure/azure-sdk-for-python/pull/29995)):\n   - Additional attributes added to existing spans:\n     - `messaging.system` - messaging system (i.e., `servicebus`)\n     - `messaging.operation` - type of operation (i.e., `publish`, `receive`, or `settle`)\n     - `messaging.batch.message_count` - number of messages sent or received (if more than one)\n   - A span will now be created upon calls to the service that settle messages.\n     - The span name will contain the settlement operation (e.g., `ServiceBus.complete`)\n     - The span will contain `az.namespace`, `messaging.destination.name`, `net.peer.name`, `messaging.system`, and `messaging.operation` attributes.\n   - All `send` spans now contain links to `message` spans. Now, `message` spans will no longer contain a link to the `send` span.\n\n## 7.10.0b1 (2023-04-13)\n\n### Features Added\n\n- A new boolean keyword argument `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.\n\n### Bugs Fixed\n\n- Fixed a bug where sync and async `ServiceBusAdministrationClient` expected `credential` with `get_token` method returning `AccessToken.token` of type `bytes` and not `str`, now matching the documentation.\n- Fixed a bug where `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.\n\n### Other Changes\n\n- The `message` attribute on `ServiceBus`/`ServiceBusMessageBatch`/`ServiceBusReceivedMessage`, which previously exposed the `uamqp.Message`/`uamqp.BatchMessage`, has been deprecated.\n  - `LegacyMessage`/`LegacyBatchMessage` objects returned by the `message` attribute on `ServiceBus`/`ServiceBusMessageBatch` have been introduced to help facilitate the transition.\n- Removed uAMQP from required dependencies.\n- Adding `uamqp >= 1.6.3` as an optional dependency for use with the `uamqp_transport` keyword.\n\n## 7.9.0 (2023-04-11)\n\n### Breaking Changes\n\n- Client side validation of input is now disabled by default for the sync and async `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.\n\n### Bugs Fixed\n\n- Fixed a bug where enum members in `azure.servicebus.management` were not following uppercase convention.\n\n### Other Changes\n\n- All pure Python AMQP stack related changes have been removed and will be added back in the next version.\n- Updated minimum `azure-core` version to 1.24.0.\n- Removed `msrest` dependency.\n- Removed `azure-common` dependency.\n\n## 7.9.0b1 (2023-03-09)\n\n### Features Added\n\n- Iterator receiving from Service Bus entities has been added back in.\n\n## 7.8.3 (2023-03-09)\n\n### Bugs Fixed\n\n- Fixed a bug where asynchronous method to add distributed tracing attributes was not being awaited (Issue #28738).\n\n## 7.8.2 (2023-01-10)\n\n### Bugs Fixed\n\n- Fixed a bug that would cause an exception when `None` was sent to `set_state` instead of clearing session state (Issue #27582).\n\n### Other Changes\n\n- Updated uAMQP dependency to 1.6.3.\n  - Added support for Python 3.11.\n\n## 7.9.0a1 (2022-10-11)\n\nVersion 7.9.0a1 is our first efforts to build an Azure Service Bus client library based on a pure Python implemented AMQP stack.\n\n### Breaking Changes\n\n- The following features have been temporarily pulled out which will be added back in future previews as we work towards a stable release:\n  - Iterator receiving from Service Bus entities.\n\n### Other Changes\n\n- uAMQP dependency is removed.\n\n## 7.8.1 (2022-10-11)\n\nThis version and all future versions will require Python 3.7+. Python 3.6 is no longer supported.\n\n### Bugs Fixed\n\n- Fixed bug on async `ServiceBusClient` where `custom_endpoint_address` and `connection_verify` kwargs were not being passed through correctly. (Issue #26015)\n\n## 7.8.0 (2022-07-06)\n\nThis version will be the last version to officially support Python 3.6, future versions will require Python 3.7+.\n\n### Features Added\n\n- In `ServiceBusClient`, `get_queue_receiver`, `get_subscription_receiver`, `get_queue_sender`, and `get_topic_sender` now accept\nan optional `client_identifier` argument which allows for specifying a custom identifier for the respective sender or receiver. It can\nbe useful during debugging as Service Bus associates the id with errors and helps with easier correlation.\n- `ServiceBusReceiver` and `ServiceBusSender` have an added property `client_identifier` which returns the `client_identifier` for the current instance.\n\n## 7.7.0 (2022-06-07)\n\n### Bugs Fixed\n\n- Fixed bug to make AMQP exceptions retryable by default, if condition is not non-retryable, to ensure that InternalServerErrors are retried.\n\n### Features Added\n\n- The `ServiceBusClient` constructor now accepts optional `custom_endpoint_address` argument\nwhich allows for specifying a custom endpoint to use when communicating with the Service Bus service,\nand is useful when your network does not allow communicating to the standard Service Bus endpoint.\n- The `ServiceBusClient`constructor now accepts optional `connection_verify` argument\nwhich allows for specifying the path to the custom CA_BUNDLE file of the SSL certificate which is used to authenticate\nthe identity of the connection endpoint.\n\n## 7.6.1 (2022-04-11)\n\n### Other Changes\n\n- Improved receiving by releasing messages from internal buffer when the `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.\n\n## 7.6.0 (2022-02-10)\n\n### Features Added\n\n- Introduce `ServiceBusMessageState` enum that can assume the values of `active`, `scheduled` or `deferred`.\n- Add `state` property in `ServiceBusReceivedMessage`.\n\n## 7.5.0 (2022-01-12)\n\nThis version and all future versions will require Python 3.6+. Python 2.7 is no longer supported.\n\n### Features Added\n\n- Added support for fixed (linear) retry backoff:\n  - Sync/async `ServiceBusClient` constructors and `from_connection_string` take `retry_mode` as a keyword argument.\n- Added new enum class `ServiceBusSessionFilter`, which is the type of existing `NEXT_AVAILABLE_SESSION` value.\n\n### Bugs Fixed\n\n- Fixed bug that when setting `ServiceBusMessage.time_to_live` with value being `datetime.timedelta`, `total_seconds` should be respected (PR #21869, thanks @jyggen).\n\n### Other Changes\n\n- Improved token refresh timing to prevent potentially blocking main flow when the token is about to get expired soon.\n- Updated uAMQP dependency to 1.5.1.\n\n## 7.4.0 (2021-11-09)\n\n### Features Added\n\n- GA the support to create and update queues and topics of large message size to `ServiceBusAdministrationClient`. This feature is only available for Service Bus of Premium Tier.\n  - Methods`create_queue`, `create_topic`, `update_queue`, `update_topic` on `ServiceBusAdministrationClient` now take a new keyword argument `max_message_size_in_kilobytes`.\n  - `QueueProperties` and `TopicProperties` now have a new instance variable `max_message_size_in_kilobytes`.\n- The constructor of`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\".\n- Added new enum class `azure.servicebus.management.ApiVersion` to represent the supported Service Bus API versions.\n\n### Bugs Fixed\n\n- Fixed bug that `ServiceBusReceiver` can not connect to sessionful entity with session id being empty string.\n- Fixed bug that `ServiceBusMessage.partition_key` can not parse empty string properly.\n\n## 7.4.0b1 (2021-10-06)\n\n### Features Added\n\n- Added support to create and update queues and topics of large message size to `ServiceBusAdministrationClient`. This feature is only available for Service Bus of Premium Tier.\n  - Methods`create_queue`, `create_topic`, `update_queue`, `update_topic` on `ServiceBusAdministrationClient` now take a new keyword argument `max_message_size_in_kilobytes`.\n  - `QueueProperties` and `TopicProperties` now have a new instance variable `max_message_size_in_kilobytes`.\n\n## 7.3.4 (2021-10-06)\n\n### Other Changes\n\n- Updated uAMQP dependency to 1.4.3.\n  - Added support for Python 3.10.\n  - Fixed memory leak in win32 socketio and tlsio (issue #19777).\n  - Fixed memory leak in the process of converting AMQPValue into string (issue #19777).\n\n## 7.3.3 (2021-09-08)\n\n### Bugs Fixed\n\n- Improved memory usage of `ServiceBusClient` to automatically discard spawned `ServiceBusSender` or `ServiceBusReceiver` from its handler set when no strong reference to the sender or receiver exists anymore.\n- Reduced CPU load of `azure.servicebus.AutoLockRenewer` during lock renewal.\n\n## 7.3.2 (2021-08-10)\n\n### Bugs Fixed\n\n- Fixed a bug that `azure.servicebus.aio.AutoLockRenewer` crashes on disposal if no messages have been registered (#19642).\n- Fixed a bug that `azure.servicebus.AutoLockRenewer` only supports auto lock renewal for `max_workers` amount of messages/sessions at a time (#19362).\n\n## 7.3.1 (2021-07-07)\n\n### Fixed\n\n- Fixed a bug that when setting `ServiceBusMessage.partition_key`, input value should be not validated against `session_id` of None (PR #19233, thanks @bishnu-shb).\n- Fixed a bug that setting `ServiceBusMessage.time_to_live` causes OverflowError error on Ubuntu 20.04.\n- Fixed a bug that `AmqpAnnotatedProperties.creation_time` and `AmqpAnnotatedProperties.absolute_expiry_time` should be calculated in the unit of milliseconds instead of seconds.\n- Updated uAMQP dependency to 1.4.1.\n  - Fixed a bug that attributes creation_time, absolute_expiry_time and group_sequence on MessageProperties should be compatible with integer types on Python 2.7.\n\n## 7.3.0 (2021-06-08)\n\n**New Features**\n\n- Support for sending AMQP annotated message which allows full access to the AMQP message fields is now GA.\n  - Introduced new namespace `azure.servicebus.amqp`.\n  - Introduced new classes `azure.servicebus.amqp.AmqpMessageHeader` and `azure.servicebus.amqp.AmqpMessageProperties` for accessing amqp header and properties.\n\n**Breaking Changes from 7.2.0b1**\n  - Renamed and moved `azure.servicebus.AMQPAnnotatedMessage` to `azure.servicebus.amqp.AmqpAnnotatedMessage`.\n  - Renamed and moved `azure.servicebus.AMQPMessageBodyType` to `azure.servicebus.amqp.AmqpMessageBodyType`.\n  - `AmqpAnnotatedMessage.header` returns `azure.servicebus.amqp.AmqpMessageHeader` instead of `uamqp.message.MessageHeader`.\n  - `AmqpAnnotatedMessage.properties` returns `azure.servicebus.amqp.AmqpMessageProperties` instead of `uamqp.message.MessageProperties`.\n  - `raw_amqp_message` on `ServiceBusMessage` and `ServiceBusReceivedMessage` is now a read-only property instead of an instance variable.\n\n**Bug Fixes**\n\n* Fixed a bug that `ServiceBusReceiver` iterator stops iteration after recovery from connection error (#18795).\n\n## 7.2.0 (2021-05-13)\n\nThe preview features related to AMQPAnnotatedMessage introduced in 7.2.0b1 are not included in this version.\n\n**New Features**\n\n* Added support for using `azure.core.credentials.AzureNamedKeyCredential` as credential for authenticating the clients.\n* Support for using `azure.core.credentials.AzureSasCredential` as credential for authenticating the clients is now GA.\n* `ServiceBusAdministrationClient.update_*` methods now accept keyword arguments to override the properties specified in the model instance.\n\n**Bug Fixes**\n\n* Fixed a bug where `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.\n* Improved the `repr` on `ServiceBusMessage` and `ServiceBusReceivedMessage` to show more meaningful text.\n* Updated uAMQP dependency to 1.4.0.\n  - Fixed memory leaks in the process of link attach where source and target cython objects are not properly deallocated (#15747).\n  - Improved management operation callback not to parse description value of non AMQP_TYPE_STRING type as string (#18361).\n\n**Notes**\n\n* Updated azure-core dependency to 1.14.0.\n\n## 7.2.0b1 (2021-04-07)\n\n**New Features**\n\n* Added support for using `azure.core.credentials.AzureSasCredential` as credential for authenticating the clients.\n* Added support for sending AMQP annotated message which allows full access to the AMQP message fields.\n  -`azure.servicebus.AMQPAnnotatedMessage` is now made public and could be instantiated for sending.\n* Added new enum class `azure.servicebus.AMQPMessageBodyType` to represent the body type of the message message which includes:\n  - `DATA`: The body of message consists of one or more data sections and each section contains opaque binary data.\n  - `SEQUENCE`: The body of message consists of one or more sequence sections and each section contains an arbitrary number of structured data elements.\n  - `VALUE`: The body of message consists of one amqp-value section and the section contains a single AMQP value.\n* Added new property `body_type` on `azure.servicebus.ServiceBusMessage` and `azure.servicebus.ReceivedMessage` which returns `azure.servicebus.AMQPMessageBodyType`.\n\n## 7.1.1 (2021-04-07)\n\nThis version and all future versions will require Python 2.7 or Python 3.6+, Python 3.5 is no longer supported.\n\n**New Features**\n\n* Updated `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`.\n\n**Bug Fixes**\n\n* Updated uAMQP dependency to 1.3.0.\n  - Fixed bug that sending message of large size triggering segmentation fault when the underlying socket connection is lost (#13739, #14543).\n  - Fixed bug in link flow control where link credit and delivery count should be calculated based on per message instead of per transfer frame (#16934).\n\n## 7.1.0 (2021-03-09)\n\nThis version will be the last version to officially support Python 3.5, future versions will require Python 2.7 or Python 3.6+.\n\n**New Features**\n\n* Updated the following methods so that lists and single instances of Mapping representations are accepted for corresponding strongly-typed object arguments (PR #14807, thanks @bradleydamato):\n  - `update_queue`, `update_topic`, `update_subscription`, and `update_rule` on `ServiceBusAdministrationClient` accept Mapping representations of `QueueProperties`, `TopicProperties`, `SubscriptionProperties`, and `RuleProperties`, respectively.\n  - `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`.\n  - `add_message` on `ServiceBusMessageBatch` now accepts a Mapping representation of `ServiceBusMessage`.\n\n**BugFixes**\n\n* Operations failing due to `uamqp.errors.LinkForceDetach` caused by no activity on the connection for 10 minutes will now be retried internally except for the session receiver case.\n* `uamqp.errors.AMQPConnectionError` errors with condition code `amqp:unknown-error` are now categorized into `ServiceBusConnectionError` instead of the general `ServiceBusError`.\n* The `update_*` methods on `ServiceBusManagementClient` will now raise a `TypeError` rather than an `AttributeError` in the case of unsupported input type.\n\n## 7.0.1 (2021-01-12)\n\n**BugFixes**\n\n* `forward_to` and `forward_dead_lettered_messages_to` will no longer cause authorization errors when used in `ServiceBusAdministrationClient` for queues and subscriptions (#15543).\n* Updated uAMQP dependency to 1.2.13.\n  - Fixed bug that macOS was unable to detect network error (#15473).\n  - Fixed bug that `uamqp.ReceiveClient` and `uamqp.ReceiveClientAsync` receive messages during connection establishment (#15555).\n  - Fixed bug where connection establishment on macOS with Clang 12 triggering unrecognized selector exception (#15567).\n  - Fixed bug in accessing message properties triggering segmentation fault when the underlying C bytes are NULL (#15568).\n\n## 7.0.0 (2020-11-23)\n\n> **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 from `v0.50` are advised to view the [migration guide](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/servicebus/azure-servicebus/migration_guide.md).\n\n**New Features**\n\n* `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`.\n* Added support for Distributed Tracing of send, receive, and schedule scenarios.\n\n**Breaking Changes**\n\n* `ServiceBusSender` and `ServiceBusReceiver` are no longer reusable and will raise `ValueError` when trying to operate on a closed handler.\n* Rename `ReceiveMode` to `ServiceBusReceiveMode` and `SubQueue` to `ServiceBusSubQueue`, and convert their enum values from ints to human-readable strings.\n* Rename enum values `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.\n* `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.\n* `ServiceBusMessage.amqp_annotated_message` has been renamed to `ServiceBusMessage.raw_amqp_message` to normalize with other SDKs.\n* Redesigned error hierarchy based on the service-defined error condition:\n  - `MessageAlreadySettled` now inherits from `ValueError` instead of `ServiceBusMessageError` as it's a client-side validation.\n  - Removed `NoActiveSession` which is now replaced by `OperationTimeoutError` as the client times out when trying to connect to any available session.\n  - Removed `ServiceBusMessageError` as error condition based exceptions provide comprehensive error information.\n  - Removed `MessageSettleFailed` as error condition based exceptions provide comprehensive error information.\n  - Removed `MessageSendFailed` as error condition based exceptions provide comprehensive error information.\n  - Renamed `MessageContentTooLarge` to `MessageSizeExceededError` to be consistent with the term defined by the service.\n  - Renamed `MessageLockExpired` to `MessageLockLostError` to be consistent with the term defined by the service.\n  - Renamed `SessionLockExpired` to `SessionLockLostError` to be consistent with the term defined by the service.\n  - Introduced `MessageNotFoundError` which would be raised when the requested message was not found.\n  - Introduced `MessagingEntityNotFoundError` which would be raised when a Service Bus resource cannot be found by the Service Bus service.\n  - Introduced `MessagingEntityDisabledError` which would be raised when the Messaging Entity is disabled.\n  - Introduced `MessagingEntityAlreadyExistsError` which would be raised when an entity with the same name exists under the same namespace.\n  - Introduced `ServiceBusQuotaExceededError` which would be raised when a Service Bus resource has been exceeded while interacting with the Azure Service Bus service.\n  - 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.\n  - Introduced `ServiceBusCommunicationError` which would be raised when there was a general communications error encountered when interacting with the Azure Service Bus service.\n  - Introduced `SessionCannotBeLockedError` which would be raised when the requested session cannot be locked.\n* Introduced new client side validation on certain use cases:\n  - `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.\n  - An improper `receive_mode` value will now raise `ValueError` instead of `TypeError` in line with supporting extensible enums.\n  - Setting `ServiceBusMessage.partition_key` to a value different than `session_id` on the message instance now raises `ValueError`.\n  - `ServiceBusClient.get_queue/topic_sender` and `ServiceBusClient.get_queue/subscription_receiver` will now\nraise `ValueError` if the `queue_name` or `topic_name` does not match the `EntityPath` in the connection string used to construct the `ServiceBusClient`.\n  - Settling a message that has been peeked will raise `ValueError`.\n  - Settling a message or renewing a lock on a message received in `RECEIVE_AND_DELETE` receive mode will raise `ValueError`.\n  - Setting `session_id`, `reply_to_session_id`, `message_id` and `partition_key` on `ServiceBusMessage` longer than 128 characters will raise `ValueError`.\n* `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.\n\n**BugFixes**\n\n* `ServiceBusAdministrationClient.create_rule` by default now creates a `TrueRuleFilter` rule.\n* FQDNs and Connection strings are now supported even with strippable whitespace or protocol headers (e.g. 'sb://').\n* Using parameter `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.\n\n## 7.0.0b8 (2020-11-05)\n\n**New Features**\n\n* Added support for `timeout` parameter on the following operations:\n  - `ServiceBusSender`: `send_messages`, `schedule_messages` and `cancel_scheduled_messages`\n  - `ServiceBusReceiver`: `receive_deferred_messages`, `peek_messages` and `renew_message_lock`\n  - `ServiceBusSession`: `get_state`, `set_state` and `renew_lock`\n* `azure.servicebus.exceptions.ServiceBusError` now inherits from `azure.core.exceptions.AzureError`.\n* Added a `parse_connection_string` method which parses a connection string into a properties bag containing its component parts\n* Add support for `auto_lock_renewer` parameter on `get_queue_receiver` and `get_subscription_receiver` calls to allow auto-registration of messages and sessions for auto-renewal.\n\n**Breaking Changes**\n\n* Renamed `AutoLockRenew` to `AutoLockRenewer`.\n* Removed class `ServiceBusSessionReceiver` which is now unified within class `ServiceBusReceiver`.\n  - Removed methods `ServiceBusClient.get_queue_session_receiver` and `ServiceBusClient.get_subscription_session_receiver`.\n  - `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.\n* The parameter `inner_exception` that `ServiceBusError.__init__` takes is now renamed to `error`.\n* Renamed `azure.servicebus.exceptions.MessageError` to `azure.servicebus.exceptions.ServiceBusMessageError`\n* Removed error `azure.servicebus.exceptions.ServiceBusResourceNotFound` as `azure.core.exceptions.ResourceNotFoundError` is now raised when a Service Bus\nresource does not exist when using the `ServiceBusAdministrationClient`.\n* Renamed `Message` to `ServiceBusMessage`.\n* Renamed `ReceivedMessage` to `ServiceBusReceivedMessage`.\n* Renamed `BatchMessage` to `ServiceBusMessageBatch`.\n  - Renamed method `add` to `add_message` on the class.\n* Removed class `PeekedMessage`.\n* Removed class `ReceivedMessage` under module `azure.servicebus.aio`.\n* Renamed `ServiceBusSender.create_batch` to `ServiceBusSender.create_message_batch`.\n* Exceptions `MessageSendFailed`, `MessageSettleFailed` and `MessageLockExpired`\n now inherit from `azure.servicebus.exceptions.ServiceBusMessageError`.\n* `get_state` in `ServiceBusSession` now returns `bytes` instead of a `string`.\n* `ServiceBusReceiver.receive_messages/get_streaming_message_iter` and\n `ServiceBusClient.get_<queue/subscription>_receiver` now raises ValueError if the given `max_wait_time` is less than or equal to 0.\n* Message settlement methods are moved from `ServiceBusMessage` to `ServiceBusReceiver`:\n  - Use `ServiceBusReceiver.complete_message` instead of `ServiceBusReceivedMessage.complete` to complete a message.\n  - Use `ServiceBusReceiver.abandon_message` instead of `ServiceBusReceivedMessage.abandon` to abandon a message.\n  - Use `ServiceBusReceiver.defer_message` instead of `ServiceBusReceivedMessage.defer` to defer a message.\n  - Use `ServiceBusReceiver.dead_letter_message` instead of `ServiceBusReceivedMessage.dead_letter` to dead letter a message.\n* Message settlement methods (`complete_message`, `abandon_message`, `defer_message` and `dead_letter_message`)\nand methods that use amqp management link for request like `schedule_messages`, `received_deferred_messages`, etc.\nnow raise more concrete exception other than `MessageSettleFailed` and `ServiceBusError`.\n* Message `renew_lock` method is moved from `ServiceBusMessage` to `ServiceBusReceiver`:\n  - Changed `ServiceBusReceivedMessage.renew_lock` to `ServiceBusReceiver.renew_message_lock`\n* `AutoLockRenewer.register` now takes `ServiceBusReceiver` as a positional parameter.\n* Removed `encoding` support from `ServiceBusMessage`.\n* `ServiceBusMessage.amqp_message` has been renamed to `ServiceBusMessage.amqp_annotated_message` for cross-sdk consistency.\n* All `name` parameters in `ServiceBusAdministrationClient` are now precisely specified ala `queue_name` or `rule_name`\n* `ServiceBusMessage.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`.\n* `ServiceBusMessage.properties` has been renamed to `ServiceBusMessage.application_properties` for consistency with service verbiage.\n* Sub-client (`ServiceBusSender` and `ServiceBusReceiver`) `from_connection_string` initializers have been made internal until needed. Clients should be initialized from root `ServiceBusClient`.\n* `ServiceBusMessage.label` has been renamed to `ServiceBusMessage.subject`.\n* `ServiceBusMessage.amqp_annotated_message` has had its type renamed from `AMQPMessage` to `AMQPAnnotatedMessage`\n* `AutoLockRenewer` `timeout` parameter is renamed to `max_lock_renew_duration`\n* Attempting to autorenew a non-renewable message, such as one received in `ReceiveAndDelete` mode, or configure auto-autorenewal on a `ReceiveAndDelete` receiver, will raise a `ValueError`.\n* The default value of parameter `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.\n\n**BugFixes**\n\n* Updated uAMQP dependency to 1.2.12.\n  - Added support for Python 3.9.\n  - Fixed bug where amqp message `footer` and `delivery_annotation` were not encoded into the outgoing payload.\n\n## 7.0.0b7 (2020-10-05)\n\n**Breaking Changes**\n\n* Passing any type other than `ReceiveMode` as parameter `receive_mode` now throws a `TypeError` instead of `AttributeError`.\n* Administration Client calls now take only entity names, not `<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).\n* `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.\n\n## 7.0.0b6 (2020-09-10)\n\n**New Features**\n\n* `renew_lock()` now returns the UTC datetime that the lock is set to expire at.\n* `receive_deferred_messages()` can now take a single sequence number as well as a list of sequence numbers.\n* Messages can now be sent twice in succession.\n* Connection strings used with `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.\n* Internal AMQP message properties (header, footer, annotations, properties, etc) are now exposed via `Message.amqp_message`\n\n**Breaking Changes**\n\n* Renamed `prefetch` to `prefetch_count`.\n* Renamed `ReceiveSettleMode` enum to `ReceiveMode`, and respectively the `mode` parameter to `receive_mode`.\n* `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.\n* No longer export `NEXT_AVAILABLE` in `azure.servicebus` module.  A null `session_id` will suffice.\n* Renamed parameter `message_count` to `max_message_count` as fewer messages may be present for method `peek_messages()` and `receive_messages()`.\n* Renamed `PeekMessage` to `PeekedMessage`.\n* Renamed `get_session_state()` and `set_session_state()` to `get_state()` and `set_state()` accordingly.\n* Renamed parameter `description` to `error_description` for method `dead_letter()`.\n* Renamed properties `created_time` and `modified_time` to `created_at_utc` and `modified_at_utc` within `AuthorizationRule` and `NamespaceProperties`.\n* Removed parameter `requires_preprocessing` from `SqlRuleFilter` and `SqlRuleAction`.\n* Removed property `namespace_type` from `NamespaceProperties`.\n* Rename `ServiceBusManagementClient` to `ServiceBusAdministrationClient`\n* Attempting to call `send_messages` on something not a `Message`, `BatchMessage`, or list of `Message`s, will now throw a `TypeError` instead of `ValueError`\n* Sending a message twice will no longer result in a MessageAlreadySettled exception.\n* `ServiceBusClient.close()` now closes spawned senders and receivers.\n* Attempting to initialize a sender or receiver with a different connection string entity and specified entity (e.g. `queue_name`) will result in an AuthenticationError\n* Remove `is_anonymous_accessible` from management entities.\n* Remove `support_ordering` from `create_queue` and `QueueProperties`\n* Remove `enable_subscription_partitioning` from `create_topic` and `TopicProperties`\n* `get_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` enum\n* No longer export `ServiceBusSharedKeyCredential`\n* Rename `entity_availability_status` to `availability_status`\n\n## 7.0.0b5 (2020-08-10)\n\n**New Features**\n\n* Added new properties to Message, PeekMessage and ReceivedMessage: `content_type`, `correlation_id`, `label`,\n`message_id`, `reply_to`, `reply_to_session_id` and `to`. Please refer to the docstring for further information.\n* Added new properties to PeekMessage and ReceivedMessage: `enqueued_sequence_number`, `dead_letter_error_description`,\n`dead_letter_reason`, `dead_letter_source`, `delivery_count` and `expires_at_utc`. Please refer to the docstring for further information.\n* Added support for sending received messages via `ServiceBusSender.send_messages`.\n* Added `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).\n* Added new supported value types int, float, datetime and timedelta for `CorrelationFilter.properties`.\n* Added new properties `parameters` and `requires_preprocessing` to `SqlRuleFilter` and `SqlRuleAction`.\n* Added an explicit method to fetch the continuous receiving iterator, `get_streaming_message_iter()` such that `max_wait_time` can be specified as an override.\n\n**Breaking Changes**\n\n* Removed/Renamed several properties and instance variables on Message (the changes applied to the inherited Message type PeekMessage and ReceivedMessage).\n  - Renamed property `user_properties` to `properties`\n      - The original instance variable `properties` which represents the AMQP properties now becomes an internal instance variable `_amqp_properties`.\n  - Removed property `enqueue_sequence_number`.\n  - Removed property `annotations`.\n  - Removed instance variable `header`.\n* Removed several properties and instance variables on PeekMessage and ReceivedMessage.\n  - Removed property `partition_id` on both type.\n  - Removed property `settled` on both type.\n  - Removed instance variable `received_timestamp_utc` on both type.\n  - Removed property `settled` on `PeekMessage`.\n  - Removed property `expired` on `ReceivedMessage`.\n* `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.\n* `AutoLockRenew.shutdown` is now `AutoLockRenew.close` to normalize with other equivalent behaviors.\n* Renamed `QueueDescription`, `TopicDescription`, `SubscriptionDescription` and `RuleDescription` to `QueueProperties`, `TopicProperties`, `SubscriptionProperties`, and `RuleProperties`.\n* Renamed `QueueRuntimeInfo`, `TopicRuntimeInfo`, and `SubscriptionRuntimeInfo` to `QueueRuntimeProperties`, `TopicRuntimeProperties`, and `SubscriptionRuntimeProperties`.\n* Removed param `queue` from `create_queue`, `topic` from `create_topic`, `subscription` from `create_subscription` and `rule` from `create_rule`\n of `ServiceBusManagementClient`. Added param `name` to them and keyword arguments for queue properties, topic properties, subscription properties and rule properties.\n* Removed model class attributes related keyword arguments from `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.\n* Model classes `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.\n* Renamed `idle_timeout` in `get_<queue/subscription>_receiver()` to `max_wait_time` to normalize with naming elsewhere.\n* Updated uAMQP dependency to 1.2.10 such that the receiver does not shut down when generator times out, and can be received from again.\n\n## 7.0.0b4 (2020-07-06)\n\n**New Features**\n\n* Added support for management of topics, subscriptions, and rules.\n* `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.\n\n**BugFixes**\n\n* Fixed bug where sync `AutoLockRenew` does not shutdown itself timely.\n* Fixed bug where async `AutoLockRenew` does not support context manager.\n\n**Breaking Changes**\n\n* Renamed `receive()`, `peek()` `schedule()` and `send()` to `receive_messages()`, `peek_messages()`, `schedule_messages()` and `send_messages()` to align with other service bus SDKs.\n* `receive_messages()` (formerly `receive()`) no longer raises a `ValueError` if `max_batch_size` is less than the `prefetch` parameter set during `ServiceBusReceiver` initialization.\n\n## 7.0.0b3 (2020-06-08)\n\n**New Features**\n\n* Added support for management of queue entities.\n    - Use `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.\n* Added methods `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.\n\n**BugFixes**\n\n* Updated uAMQP dependency to 1.2.8.\n    * Fixed bug where reason and description were not being set when dead-lettering messages.\n\n## 7.0.0b2 (2020-05-04)\n\n**New Features**\n\n* Added method `get_topic_sender` in `ServiceBusClient` to get a `ServiceBusSender` for a topic.\n* Added method `get_subscription_receiver` in `ServiceBusClient` to get a `ServiceBusReceiver` for a subscription under specific topic.\n* Added support for scheduling messages and scheduled message cancellation.\n    - Use `ServiceBusSender.schedule(messages, schedule_time_utc)` for scheduling messages.\n    - Use `ServiceBusSender.cancel_scheduled_messages(sequence_numbers)` for scheduled messages cancellation.\n* `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.\n* `BatchMessage.add()` and `ServiceBusSender.send()` would raise `MessageContentTooLarge` if the content is over-sized.\n* `ServiceBusReceiver.receive()` raises `ValueError` if its param `max_batch_size` is greater than param `prefetch` of `ServiceBusClient`.\n* Added exception classes `MessageError`, `MessageContentTooLarge`, `ServiceBusAuthenticationError`.\n   - `MessageError`: when you send a problematic message, such as an already sent message or an over-sized message.\n   - `MessageContentTooLarge`: when you send an over-sized message. A subclass of `ValueError` and `MessageError`.\n   - `ServiceBusAuthenticationError`: on failure to be authenticated by the service.\n* Removed exception class `InvalidHandlerState`.\n\n**BugFixes**\n\n* Fixed bug where http_proxy and transport_type in ServiceBusClient are not propagated into Sender/Receiver creation properly.\n* Updated uAMQP dependency to 1.2.7.\n    * Fixed bug in setting certificate of tlsio on MacOS. #7201\n    * Fixed bug that caused segmentation fault in network tracing on MacOS when setting `logging_enable` to `True` in `ServiceBusClient`.\n\n**Breaking Changes**\n\n* Session receivers are now created via their own top level functions, e.g. `get_queue_sesison_receiver` and `get_subscription_session_receiver`.  Non session receivers no longer take session_id as a paramter.\n* `ServiceBusSender.send()` no longer takes a timeout parameter, as it should be redundant with retry options provided when creating the client.\n* Exception imports have been removed from module `azure.servicebus`. Import from `azure.servicebus.exceptions` instead.\n* `ServiceBusSender.schedule()` has swapped the ordering of parameters `schedule_time_utc` and `messages` for better consistency with `send()` syntax.\n\n## 7.0.0b1 (2020-04-06)\n\nVersion 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.\n* Note: Not all historical functionality exists in this version at this point.  Topics, Subscriptions, scheduling, dead_letter management and more will be added incrementally over upcoming preview releases.\n\n**New Features**\n\n* Added new configuration parameters when creating `ServiceBusClient`.\n    * `credential`: The credential object used for authentication which implements `TokenCredential` interface of getting tokens.\n    * `http_proxy`: A dictionary populated with proxy settings.\n    * For detailed information about configuration parameters, please see docstring in `ServiceBusClient` and/or the reference documentation for more information.\n* Added support for authentication using Azure Identity credentials.\n* Added support for retry policy.\n* Added support for http proxy.\n* Manually calling `reconnect` should no longer be necessary, it is now performed implicitly.\n* Manually calling `open` should no longer be necessary, it is now performed implicitly.\n    * Note: `close()`-ing is still required if a context manager is not used, to avoid leaking connections.\n* Added support for sending a batch of messages destined for heterogenous sessions.\n\n**Breaking changes**\n\n* Simplified API and set of clients\n    * `get_queue` no longer exists, utilize `get_queue_sender/receiver` instead.\n    * `peek` and other `queue_client` functions have moved to their respective sender/receiver.\n    * Renamed `fetch_next` to `receive`.\n    * Renamed `session` to `session_id` to normalize naming when requesting a receiver against a given session.\n    * `reconnect` no longer exists, and is performed implicitly if needed.\n    * `open` no longer exists, and is performed implicitly if needed.\n* Normalized top level client parameters with idiomatic and consistent naming.\n    * Renamed `debug` in `ServiceBusClient` initializer to `logging_enable`.\n    * Renamed `service_namespace` in `ServiceBusClient` initializer to `fully_qualified_namespace`.\n* New error hierarchy, with more specific semantics\n    * `azure.servicebus.exceptions.ServiceBusError`\n    * `azure.servicebus.exceptions.ServiceBusConnectionError`\n    * `azure.servicebus.exceptions.ServiceBusResourceNotFound`\n    * `azure.servicebus.exceptions.ServiceBusAuthorizationError`\n    * `azure.servicebus.exceptions.NoActiveSession`\n    * `azure.servicebus.exceptions.OperationTimeoutError`\n    * `azure.servicebus.exceptions.InvalidHandlerState`\n    * `azure.servicebus.exceptions.AutoLockRenewTimeout`\n    * `azure.servicebus.exceptions.AutoLockRenewFailed`\n    * `azure.servicebus.exceptions.EventDataSendError`\n    * `azure.servicebus.exceptions.MessageSendFailed`\n    * `azure.servicebus.exceptions.MessageLockExpired`\n    * `azure.servicebus.exceptions.MessageSettleFailed`\n    * `azure.servicebus.exceptions.MessageAlreadySettled`\n    * `azure.servicebus.exceptions.SessionLockExpired`\n* BatchMessage creation is now initiated via `create_batch` on a Sender, using `add()` on the batch to add messages, in order to enforce service-side max batch sized limitations.\n* Session is now set on the message itself, via `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.\n* Session management is now encapsulated within a property of a receiver, e.g. `receiver.session`, to better compartmentalize functionality specific to sessions.\n    * To use `AutoLockRenew` against sessions, one would simply pass the inner session object, instead of the receiver itself.\n\n## 0.50.2 (2019-12-09)\n\n**New Features**\n\n* Added support for delivery tag lock tokens\n\n**BugFixes**\n\n* Fixed bug where Message would pass through invalid kwargs on init when attempting to thread through subject.\n* Increments UAMQP dependency min version to 1.2.5, to include a set of fixes, including handling of large messages and mitigation of segfaults.\n\n## 0.50.1 (2019-06-24)\n\n**BugFixes**\n\n* Fixed bug where enqueued_time and scheduled_enqueue_time of message being parsed as local timestamp rather than UTC.\n\n\n## 0.50.0 (2019-01-17)\n\n**Breaking changes**\n\n* Introduces new AMQP-based API.\n* Original HTTP-based API still available under new namespace: azure.servicebus.control_client\n* For full API changes, please see updated [reference documentation](https://docs.microsoft.com/python/api/azure-servicebus/azure.servicebus?view=azure-python).\n\nWithin the new namespace, the original HTTP-based API from version 0.21.1 remains unchanged (i.e. no additional features or bugfixes)\nso for those intending to only use HTTP operations - there is no additional benefit in updating at this time.\n\n**New Features**\n\n* New API supports message send and receive via AMQP with improved performance and stability.\n* New asynchronous APIs (using `asyncio`) for send, receive and message handling.\n* Support for message and session auto lock renewal via background thread or async operation.\n* Now supports scheduled message cancellation.\n\n\n## 0.21.1 (2017-04-27)\n\nThis wheel package is now built with the azure wheel extension\n\n## 0.21.0 (2017-01-13)\n\n**New Features**\n\n* `str` messages are now accepted in Python 3 and will be encoded in 'utf-8' (will not raise TypeError anymore)\n* `broker_properties` can now be defined as a dict, and not only a JSON `str`. datetime, int, float and boolean are converted.\n* #902 add `send_topic_message_batch` operation (takes an iterable of messages)\n* #902 add `send_queue_message_batch` operation (takes an iterable of messages)\n\n**Bugfixes**\n\n* #820 the code is now more robust to unexpected changes on the SB RestAPI\n\n## 0.20.3 (2016-08-11)\n\n**News**\n\n* #547 Add get dead letter path static methods to Python\n* #513 Add renew lock\n\n**Bugfixes**\n\n* #628 Fix custom properties with double quotes\n\n## 0.20.2 (2016-06-28)\n\n**Bugfixes**\n\n* New header in Rest API which breaks the SDK #658 #657\n\n## 0.20.1 (2015-09-14)\n\n**News**\n\n* Create a requests.Session() if the user doesn't pass one in.\n\n## 0.20.0 (2015-08-31)\n\nInitial release of this package, from the split of the `azure` package.\nSee the `azure` package release note for 1.0.0 for details and previous\nhistory on Service Bus.\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Microsoft Azure Service Bus Client Library for Python",
    "version": "7.12.2",
    "project_urls": {
        "Homepage": "https://github.com/Azure/azure-sdk-for-python"
    },
    "split_keywords": [
        "azure",
        " azure sdk"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "2355b39af8422f5efa2d546bf7073e199fa0c1bcac2245b011a6c75c955d2cec",
                "md5": "699a3822c4126aa7fa0cc7d9995a50a1",
                "sha256": "505015e894ba82b5419ebf825b47661a315a04359a42087f2f75494bdcbb214b"
            },
            "downloads": -1,
            "filename": "azure_servicebus-7.12.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "699a3822c4126aa7fa0cc7d9995a50a1",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 408212,
            "upload_time": "2024-05-08T20:59:41",
            "upload_time_iso_8601": "2024-05-08T20:59:41.507461Z",
            "url": "https://files.pythonhosted.org/packages/23/55/b39af8422f5efa2d546bf7073e199fa0c1bcac2245b011a6c75c955d2cec/azure_servicebus-7.12.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "3cc4cf0de3625417c0ffa86d7432124cbfc2b4c60d5ed5fb84a81377ffaa35cd",
                "md5": "118df4c1eac4b214d61364c7a875d759",
                "sha256": "a6a3c5f79ed5bef101d9e3e3c986a103b200e26c4953c47a52f552c757e45eca"
            },
            "downloads": -1,
            "filename": "azure-servicebus-7.12.2.tar.gz",
            "has_sig": false,
            "md5_digest": "118df4c1eac4b214d61364c7a875d759",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 509780,
            "upload_time": "2024-05-08T20:59:38",
            "upload_time_iso_8601": "2024-05-08T20:59:38.097315Z",
            "url": "https://files.pythonhosted.org/packages/3c/c4/cf0de3625417c0ffa86d7432124cbfc2b4c60d5ed5fb84a81377ffaa35cd/azure-servicebus-7.12.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-08 20:59:38",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Azure",
    "github_project": "azure-sdk-for-python",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "lcname": "azure-servicebus"
}
        
Elapsed time: 0.36441s