Skip to content

Commit

Permalink
[SB] merge pyproto main2 (#30269)
Browse files Browse the repository at this point in the history
* upstream + sb pyamqp

* pyamqp from eventhub

* asyncio markers on async tests

* remove recordings

* updating sender and session from main

* missing req

* [Service Bus] Performance Tests (#28399)

* delete t1 tests

* perf tests

* fix size

* few small fixes for topic

* perf tests redone

* stream tests

* update logic to handle recv & del

* restructure classes

* formatting

* preload only delta messages

* fixes

* rename test files

* swathis comments

* perf bicep

* fix transport & remove shared

* if peeklock, then complete

* make batch receive batchperftests

* restructure classes

* fix

* fixes for max_count

* fix wording

* minor clean up

* move add args to mixin

* [ServiceBus] Iterator Support (#28558)

* iterator

* add todo

* remove logger

* tests

* skip serialization and pyamp transport errors

* add in keep-alive for releasing messages

* try this for client.py

* trying to fix iterator vs normal receiving timeout for releasing messages

* remove part of test failing for sync release -- doesnt work on pyamqp

* make message yeilding a while loop

* copying changes to async

* fixing async release test

* message_received was set incorrectly/ diff than uamqp

* fix async

* fixing closing order logic

* receive_contxt, fix test

* another receive_context

* asyncio.lock

* receiver_context

* try to ignore sync for now

* async with lock

* receive_context

* remove print statements

* unskip sync

* fix pylint and mypy

* skip tests except for failing one

* mark not mock

* socket read timeout set to 1 but was .2 on sync

* run all tests with new timeout

* pr comments

* pr comments

* typing add back

* remove todo

* time to live - ttl

* async init

* async init

* pr comments

* Revert "pr comments"

This reverts commit f8c96f2.

* pr comments - lock rename

* pr comments - remove timeout setting for uamqp

* tests

* set link credit in connection listen on keep alive

* link async

* change pop to get

* try flow before connection

* test

* link credit not bein kept bc of flow in client_run

* if link credit is 0, reset it

* add wait_time to tests

* time override test

* Connection to Link Error

* sleep fix

* link_credit

* missing _ in test

* remove boolean flag

* need actibvity timestamp in yeild message

* missing "_"

* stamp ->timestamp

* dont fix EH here

* formatting pylint

* sock timeout async

* whitespace

* remove __aiter__

* need iter

* remove todo

* todo

* whitespace

* iter_context

* remove self

* tests - remove #pytest.skip

* add timeouts to constants

* merge together if statements

* timeout

* missing if

* pylint

* pylint

* whitespace

* todo

* if statement :)

* pylint/remove whitespace

* [ServiceBus] merge EH pyamqp into SB pyamqp (#29223)

* [TEMPORARY] adding eh _pyamqp folder

* [TEMP] add _pyamqp/aio

* undo removing client lock

* lint

* [ServiceBus] update pyproto b1 version/changelog/readme (#29251)

* [ServiceBus] update changelog 7.9.0b1 (#29267)

* Increment version for servicebus releases (#29268)

Increment package version after release of azure-servicebus

* [ServiceBus] Pyamqp Changes from EH in SB (#29499)

* frame fix sync

* frame fix async

* [ServiceBus] uamqp/pyamqp switch (#28512)

- Added _pyamqp_transport.py/_uamqp_transport.py, which contain all corresponding uamqp/pyamqp code.
TODO:
- tests:
  - [ ] manually create ServiceBusMessageBatch and set client to `uamqp_transport=True` when sending.

* [ServiceBus] Files for SB Perf Tests (#29503)

* files for perf test CI

* fix args, vals based on comments

* remove unused params

* add batch size back in to perf test

* add in add_arguments in to send base

* adjust message size

* fix

* [Service Bus] Fix System.Byte[] Not Supported (#29670)

* add in string decode for 161

* app keys are now strings

* app keys are now strings

* remove decode

* revert changes

* decode if app props val is bytes

* remove change from pyamqp layer

* move fix in to outgoing message

* remove extra )

* fix

* mypy and pylint

* fix in back_compat

* rephrase

* [ServiceBus] Fix sb perf test (#29765)

* fixes for perf bicep

* fix env vars and params

* [ServiceBus] prep release 7.10.0b1 (#29815)

* prep for release

* update readmes

* update docs for switch

* remove uamqp dev req temporarily

* fix mypy/pylint

* add back uamqp to dev reqs

* merge main in topyamqp

* update release date

* Increment package version after release of azure-servicebus (#29881)

* [SB] Remove references to internal streaming method (#29750)

* remove streaming

* update stress

* move uamqp transport imports into client constructor (#29921)

* [ServiceBus][Perf] Fix perf tests (#30004)

Some async tests were trying to use an synchronous receiver/sender.
This fixes that so that the tests can run.

Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>

* [SB Pyamqp] stress updates (#29783)

* stress updates

* changes

* add memray to stress

* undo docker file changes

* add memray chaos

* timeoutError raise

* devred

* try log to file

* test indiv

* test indv

* updates

* tests

* logging_enable

* stress

* update

* delete

* remove changes to code

* change level

* update chart.yaml

* update to local running of indv components

* updates

* remove

* update

* update test base

* remove eh changes

* logging

* update jpb

* update docker

* update scenarios

* logging

---------

Co-authored-by: swathipil <swathip@microsoft.com>

* [ServiceBus] Update tracing (#29995)

* [ServiceBus] Update tracing

- "Send" span now contains links to message spans.
- Receive span is now kind CLIENT instead of CONSUMER.
- Added span creation logic for settlement methods.
- Attribute names were updated to align with distributed
  tracing conventions.
- Some span named renamed to align with other SDKs.
- Receive spans now have more accurate start times.

Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>

* Refactor tracing utils

Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>

* Remove unneeded arg from trace_message

Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>

* update changelog

Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>

* Remove use of `messaging.source.name`

This is slated to be removed in favor of `messaging.destination.name`
for everything. Here, we maintain use of the legacy attribute name
`message_bus.destination`.

Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>

* remove test-resources.bicep from stress

---------

Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
Co-authored-by: swathipil <swathip@microsoft.com>

* [ServiceBus] Fix Memory Leak on Network Drop + Use Asyncio Streams (#29904)

* use non blocking socket + raise on errno 110

* pylint fixes

* comment for errno 110

* [ServiceBus] pyamqp exception parity (#30020)

* unskip tests

* test passing uamqp.TransportType

* make sbreceived messages picklable

* edge case sb message batch creation test

* remove accidental additions

* add sb client tests

* add invalid custom endpoint tests

* update pyamqp invalid custom endpoint error

* add test_errors back to folder

* add more tests

* lint

* fix unskipped async test

* kashif comments

* fix asyncio pickling for <3.11

* lint

* unpickle clients

* remove receiver/uamqp message from received message pickling

* annas comments

* update version + changelog

* update amqp transport kind check in message

* changelog + update to stable

* pull main again

* update readme/typing

* test session set_state None

---------

Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
Co-authored-by: l0lawrence <llawrence@microsoft.com>
Co-authored-by: Kashif Khan <361477+kashifkhan@users.noreply.github.com>
Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com>
Co-authored-by: Paul Van Eck <paulvaneck@microsoft.com>
  • Loading branch information
5 people committed May 7, 2023
1 parent 564928c commit ee85ddd
Show file tree
Hide file tree
Showing 134 changed files with 22,405 additions and 3,489 deletions.
42 changes: 40 additions & 2 deletions sdk/servicebus/azure-servicebus/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,53 @@
# Release History

## 7.9.1 (Unreleased)
## 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

### Breaking Changes
- 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.
- 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
Expand Down
29 changes: 29 additions & 0 deletions sdk/servicebus/azure-servicebus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -480,12 +480,41 @@ For users seeking to perform management operations against ServiceBus (Creating
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.

### 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
Expand Down
5 changes: 1 addition & 4 deletions sdk/servicebus/azure-servicebus/azure/servicebus/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# -------------------------------------------------------------------------
from uamqp import constants

from ._version import VERSION

__version__ = VERSION
Expand All @@ -23,6 +21,7 @@
ServiceBusSubQueue,
ServiceBusMessageState,
ServiceBusSessionFilter,
TransportType,
NEXT_AVAILABLE_SESSION,
)
from ._common.auto_lock_renewer import AutoLockRenewer
Expand All @@ -31,8 +30,6 @@
ServiceBusConnectionStringProperties,
)

TransportType = constants.TransportType

__all__ = [
"ServiceBusMessage",
"ServiceBusMessageBatch",
Expand Down
Loading

0 comments on commit ee85ddd

Please sign in to comment.