RabbitMQ AMQP 1.0 Python Client
This library is meant to be used with RabbitMQ 4.x.
Version 2.0 is coming
Version 1.0 will be deprecated. Please follow the version 2.0 Consider upgrading the library to version 2.0. Check the 2.x releases
Install
The client is distributed via PIP:
pip install rabbitmq-amqp-python-client
Getting Started
Inside the examples folder you can find a set of examples that show how to use the client.
Documentation
Client Guide select the python section.
Build
make rabbitmq-server: run the RabbitMQ server in a docker containerpoetry build: build the source projectpoetry install: resolves and install dependenciesmake test: run the tests
Note for MAC users:
To run TLS you need to:
- pip uninstall python-qpid-proton
- brew install swig
- brew install pkg-config
- export CFLAGS="-I/usr/local/opt/openssl/include"; pip install python-qpid-proton --verbose --no-cache-dir
Read more about the issue here
SSL Problems in local environment
If when running tests, this exceptions is raised by the proton library: SSLUnavailable:
pip uninstall python-qpid-proton -y
sudo apt-get update
sudo apt-get install -y swig cmake build-essential libssl-dev pkg-config
export PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig
export CFLAGS="-I/usr/include/openssl"
export LDFLAGS="-L/usr/lib/x86_64-linux-gnu"
pip install "python-qpid-proton>=0.39.0,<0.40.0" --no-binary python-qpid-proton --verbose --no-cache-dir
Async Interface
The client provides an async interface via the rabbitmq_amqp_python_client.asyncio module. The async classes act as facades that:
- Wrap the corresponding synchronous classes
- Execute blocking operations in a thread pool executor using
run_in_executor - Coordinate concurrent access using
asyncio.Lock - Implement proper async context managers (
async with) for resource management - Maintain API compatibility with the synchronous version
Key differences from the synchronous interface:
- Use
AsyncEnvironmentinstead ofEnvironment - All operations must be awaited with
await - Use
async withfor resource management (connections, publishers, consumers, management) - Consumer signal handling uses
asyncio.Eventandloop.add_signal_handler
For a complete example showing proper consumer termination and signal handling, refer to:
Additional async examples are available in the examples folder:
- OAuth2: examples/oauth/oAuth2_async.py
- Reconnection: examples/reconnection/reconnection_example_async.py
- Streams: examples/streams/example_with_streams_async.py
- TLS: examples/tls/tls_example_async.py
Thread Safety
The TCP connection is not thread safe. If you want to use the client in a multithreaded environment, you should create a connection per thread.
Metadata
Release files for rabbitmq-amqp-python-client 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rabbitmq_amqp_python_client-1.0.2.tar.gz | 120.3 kB | Without provenance | Details for rabbitmq_amqp_python_client-1.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| rabbitmq_amqp_python_client-1.0.2-py3-none-any.whl | Python 3 | none | any | Details for rabbitmq_amqp_python_client-1.0.2-py3-none-any.whl |
Total release size: 270.3 kB
Release files / rabbitmq_amqp_python_client-1.0.2.tar.gz
| Download URL | rabbitmq_amqp_python_client-1.0.2.tar.gz |
|---|---|
| Size | 120.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b01da0810d18519fe03d76c7468c6028338e6bedf139b16d73eb851b2e3a9458
|
|
BLAKE2b-256 checksum How to use checksums |
f27d2b14e32f7826b7ac3bf45126e7c5570fe7c0c8a8d55443f4a5b29f967abc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / rabbitmq_amqp_python_client-1.0.2-py3-none-any.whl
| Download URL | rabbitmq_amqp_python_client-1.0.2-py3-none-any.whl |
|---|---|
| Size | 150.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9fa376acfb35fe839de7de8345adfdd806077696f2e37cec8a89d3f5d58480de
|
|
BLAKE2b-256 checksum How to use checksums |
d5aa695e98490c8256f1f8c43c84a37d3194eb231dbe362c97bc6e32bf9361c0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Security for rabbitmq-amqp-python-client 1.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.