Skip to main content

rabbitmq-pika-adapter

Lightweight RabbitMQ client helpers built on pika (sync) and aio-pika (async).

Core API:

  • Sync publish: PublisherPool (recommended)
  • Sync consume: Listener
  • Async publish/consume: AsyncSender, AsyncListener (optional extra)
  • Facade: RabbitMQClient (recommended entrypoint)

Acknowledgements (auto_ack)

Consumers support two acknowledgement modes:

  • auto_ack=False (default): at-least-once delivery. The library will ack after your callback returns successfully, and nack/requeue on exception. Your handler should be idempotent because messages may be redelivered.
  • auto_ack=True (legacy): at-most-once delivery. Messages are considered acknowledged on delivery. If your callback raises or the process crashes mid-processing, RabbitMQ will not redeliver that message.

Recommendation: for most "work queue" style consumers, use auto_ack=False.

See docs/USAGE.md for details and examples.

Installation

From PyPI:

pip install rabbitmq-pika-adapter

Async support:

pip install rabbitmq-pika-adapter[async]

This enables AsyncSender and AsyncListener.

Usage

Recommended entrypoint:

  • RabbitMQClient(...).publisher(...) / .listener(...)

Direct usage (advanced/explicit):

  • Listener(message_type, callback, ...) - thread-based consumer.
  • PublisherPool(message_type, ...) - sync publisher with pooled channels.
  • AsyncListener(message_type, callback, ...) - asyncio-based consumer.
  • AsyncSender(message_type, ...) - asyncio-based publisher.

See examples/usage.py and docs/USAGE.md.

Examples

  • High-throughput sync publish+consume demo (prints stats for both):

    python examples/usage.py throughput

Notes:

  • The repo uses a src/ layout. If you want to run examples without installing the package, examples/usage.py will automatically add src/ to sys.path.

Testing

Install test deps:

pip install -e .[test]

Run unit tests:

python -m pytest -q

Integration tests (no Docker)

Integration tests are opt-in and require a reachable RabbitMQ. Set env vars:

  • RABBITMQ_HOST (or RABBITMQ_SERVER)
  • RABBITMQ_PORT
  • RABBITMQ_VHOST
  • RABBITMQ_USER
  • RABBITMQ_PASSWORD

Then run:

python -m pytest -m integration -q

Publishing to PyPI

This repo publishes from GitHub Actions:

  • Pushes to develop publish to TestPyPI.
  • Pushes to release publish to PyPI.

Manual build/publish:

python -m pip install build twine
python -m build
python -m twine check dist/*
python -m twine upload dist/*

Metadata

Release files for rabbitmq-pika-adapter 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rabbitmq-pika-adapter 0.2.2
File Size Uploaded Provenance Actions
rabbitmq_pika_adapter-0.2.2.tar.gz 37.6 kB Without provenance Details for rabbitmq_pika_adapter-0.2.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rabbitmq-pika-adapter 0.2.2
File Interpreter ABI Platform Actions
rabbitmq_pika_adapter-0.2.2-py3-none-any.whl Python 3 none any Details for rabbitmq_pika_adapter-0.2.2-py3-none-any.whl

Total release size: 68.2 kB

Release files / rabbitmq_pika_adapter-0.2.2.tar.gz

Download URL rabbitmq_pika_adapter-0.2.2.tar.gz
Size 37.6 kB
Tags Source
SHA-256 checksum
How to use checksums
1bf23696dd5597b73a89f34b653326c253c7714c228ba1f34d6c4b0eb258757a
BLAKE2b-256 checksum
How to use checksums
5b4cd982ead9c1e3b48e8b5f222c91727e947b0826ae36d5c4b865e7479fa41b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release files / rabbitmq_pika_adapter-0.2.2-py3-none-any.whl

Download URL rabbitmq_pika_adapter-0.2.2-py3-none-any.whl
Size 30.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e3ec326a5969c96feeeaf456c48b73e61a95d0c32ce714503c64afdf33b38005
BLAKE2b-256 checksum
How to use checksums
160bb2b8be6f7a4ec2c1d27e83b82af61c5dbb5fa585d0679aa671f89f1c0bfe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Security for rabbitmq-pika-adapter 0.2.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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page