uamqp
AMQP 1.0 Client Library for Python
Description
uAMQP for Python
An AMQP 1.0 client library for Python.
Disclaimer
This repo is no longer in active maintenance and we plan on deprecating it sometime in the first quarter of 2025. The EventHubs & Service Bus client libraries are now using the python based AMQP library which is under active development. If there is interest in using the new python library as standalone, please share your interest in this issue.
uAMQP for Python requires Python 3.6+ starting from v1.5, and Python 2.7 is no longer supported. If Python 2.7 is required, please install uAMQP v1.4.3:
$ pip install uamqp==1.4.3
Installation
Wheels are provided for most major operating systems, so you can install directly with pip:
$ pip install uamqp
If you are running a Linux distro that does not support ManyLinux1 or you need to customize the build based on your system settings and packages, you can install from source:
$ apt-get update
$ apt-get install -y build-essential libssl-dev uuid-dev cmake libcurl4-openssl-dev pkg-config python3-dev python3-pip $ pip3 install uamqp --no-binary :all:
If you are running Alpine, you can install from source:
$ apk add --update python3 py-pip python3-dev cmake gcc g++ openssl-dev build-base $ pip3 install uamqp --no-binary :all:
If you are running Red Hat, you can install from source:
$ yum install cmake gcc gcc-c++ make openssl-devel python3-devel $ pip3 install uamqp --no-binary :all:
Documentation
Reference documentation can be found here: docs.microsoft.com/python/api/uamqp/uamqp.
Developer Setup
In order to run the code directly, the Cython extension will need to be build first.
Pre-requisites
- Windows: Setup a build environment. - Linux: Install dependencies as descriped above in the installation instructions. - MacOS: Install cmake using Homebrew:
$ brew install cmake
Building the extension
This project has two C library dependencies. They are vendored in this repository in these versions:
To build, start by creating a virtual environment and installing the required Python packages:
$ python -m venv env
$ env/Scripts/activate
(env)$ pip install -r dev_requirements.txt
Next, run the build command:
$ python setup.py build_ext --inplace
Tests
The tests can be run from within the virtual environment. The extension must be built first using the instructions above.
(env)$ pytest
Provide Feedback
If you encounter any bugs or have suggestions, please file an issue in the Issues section of the project.
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. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
Release History
1.6.11 (2024-10-28)
- Added support for python 3.13
- Updated OpenSSL dependency to 3.0 LTS
- Updated Cython dependency to 3.0.11
- Updated Azure uAMQP C and Azure C Shared Utility dependencies
1.6.10 (2024-09-11)
- Incorporate fixes from PR to update vendor uamqp code.
1.6.9 (2024-03-20)
- Incorporate fixes from PR
1.6.8 (2024-01-29)
- Incorporate fixes from PR
1.6.7 (2024-01-17)
- Fixes for CVE-2024-21646
1.6.6 (2023-11-16)
- Added support for python 3.11
1.6.5 (2023-07-12)
- Few more updates to submodules to support OpenSSL 3.0 compilation
1.6.4 (2023-02-09)
- Updated OpenSSL dependency to 1.1.1t
- Updated submodules to support OpenSSL 3.0 compilation
- Removed dependency on six
- Fixed a bug that caused the wrong port to selected for websockets when a port was not passed in
1.6.3 (2022-10-27)
- Publish 3.11 wheels
1.6.2 (2022-10-27)
- Added support for python 3.11
- Updated OpenSSL dependency to 1.1.1q
- Updated cython dependency to 0.29.32
- Dropped support for manylinux2010
- Using cibuildwheel to generate wheels
1.6.1 (2022-10-11)
- Added support for handling of duplicate certificates in [azure-c-shared-utility]{.title-ref} dependency by using [CERT_STORE_ADD_REPLACE_EXISTING]{.title-ref} parameter in the [CertAddEncodedCertificateToStore]{.title-ref} function call. (azure-sdk-for-python issue #26034)
1.6.0 (2022-08-18)
This version and all future versions will require Python 3.7+, Python 3.6 is no longer supported.
- Added [data]{.title-ref}, [value]{.title-ref}, [sequence]{.title-ref} properties to [uamqp.Message]{.title-ref}, which return the body if the body type corresponds.
- Added [message_annotations]{.title-ref} property to [uamqp.Message]{.title-ref}, which is an alias for the [annotations]{.title-ref} instance variable.
- Added [data]{.title-ref} property to [uamqp.BatchMessage]{.title-ref}, which returns the iterable body of the batch.
- Added [ttl]{.title-ref} property to [uamqp.MessageHeader]{.title-ref}, which is an alias for the [time_to_live]{.title-ref} instance variable.
1.5.3 (2022-03-23)
- Updated OpenSSL dependency to 1.1.1n for wheels of manylinux and macOS.
1.5.2 (2022-03-15)
- Fixed bug that resulted in an error when deepcopying BatchMessage objects (azure-sdk-for-python issue #22529).
1.5.1 (2022-01-12)
- Added back the support for Python 3.6.
1.5.0 (2022-01-05)
This version and all future versions will require Python 3.7+, Python 2.7 and Python 3.6 are no longer supported.
- [SASTokenAuth]{.title-ref}, [JWTTokenAuth]{.title-ref}, [SASTokenAsync]{.title-ref}, and [JWTTokenAsync]{.title-ref} now takes keyword argument [refresh_window]{.title-ref} to override default token refresh timing in constructors.
- Fixed bug that [SendClientAsync]{.title-ref} might run into infinite loop while sending when it is shutdown unexpectedly.
- Updated dependencies Azure uAMQP C @ 2021-11-16 and Azure C Shared Utility @ 2021-11-15.
- Fixed bug that the [keep_alive_thread]{.title-ref} of [AMQPClient]{.title-ref} should not keep program from exiting in the case of [AMQPClient]{.title-ref} not being closed properly.
1.4.3 (2021-10-06)
- Added support for Python 3.10.
1.4.2 (2021-09-21)
- Fixed memory leak in win32 socketio and tlsio (azure-sdk-for-python issue #19777).
- Fixed memory leak in the process of converting AMQPValue into string (azure-sdk-for-python issue #19777).
1.4.1 (2021-06-28)
- Fixed bug that JWTTokenAuth and JWTTokenAsync do not initialize token for token types other than b'jwt'.
- Fixed bug that attibutes [creation_time]{.title-ref}, [absolute_expiry_time]{.title-ref} and [group_sequence]{.title-ref} on [MessageProperties]{.title-ref} should be compatible with integer types on Python 2.7.
1.4.0 (2021-05-03)
This version and all future versions will require Python 2.7 or Python 3.6+, Python 3.5 is no longer supported.
- Fixed memory leaks in the process of link attach where source and target cython objects are not properly deallocated (azure-sdk-for-python issue #15747).
- Improved management operation callback not to parse description value of non AMQP_TYPE_STRING type as string (azure-sdk-for-python issue #18361).
1.3.0 (2021-04-05)
This version will be the last version to officially support Python 3.5, future versions will require Python 2.7 or Python 3.6+.
-
Added support for AMQP Sequence as the body type of an amqp message.
-
Added new class [uamqp.MessageBodyType]{.title-ref} to represent the body type of an amqp message, including:
- `Data`: The body consists of one or more data sections and each section contains opaque binary data. > - `Seque