Python RabbitMQ client for AMQP 1.0 protocol
Project description
RabbitMQ AMQP 1.0 Python Client
This library is meant to be used with RabbitMQ 4.x. Suitable for testing in pre-production environments.
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 (Experimental)
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:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rabbitmq_amqp_python_client-0.4.1.tar.gz.
File metadata
- Download URL: rabbitmq_amqp_python_client-0.4.1.tar.gz
- Upload date:
- Size: 113.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6d942bfe5038557a65ca3043841b6157d124df65f7468c7aaef6a203ae38681a
|
|
| MD5 |
a852729a35e7057da41f9de726fc013f
|
|
| BLAKE2b-256 |
aa15a2a04e83f6f44af98ff368614ba7f7e77c79511fb6f0111c5e07f7fc76b0
|
File details
Details for the file rabbitmq_amqp_python_client-0.4.1-py3-none-any.whl.
File metadata
- Download URL: rabbitmq_amqp_python_client-0.4.1-py3-none-any.whl
- Upload date:
- Size: 143.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc79253db8a69235a482d9d557d7a2be187bd57ed81143e9c8d644f7c685c093
|
|
| MD5 |
fac593911feb8d473fa8bb7a004b1a28
|
|
| BLAKE2b-256 |
4b3d37578fd192572e2aa0fb28ee294ddb93a54fa6ec491e38a9cc5ce6cc1d28
|