Skip to main content

WeenSpace RabbitMQ Client

PyPI version Python 3.13+ License

A powerful Python RabbitMQ client for AMQP 1.0 protocol, designed for event-driven microservices architecture.

✨ Features

  • 🔐 Authentication: OAuth2, TLS/SSL, Basic Auth
  • 📬 Queue Types: Classic, Quorum, Stream queues
  • ☠️ Dead Letter Queues: Built-in DLQ support with configurable strategies
  • ⚡ Priority Queues: Native priority queue support
  • 🔄 Auto Reconnection: Configurable recovery with exponential backoff
  • 🔀 All Exchange Types: Direct, Fanout, Topic, Headers
  • 🚀 Async Support: Native asyncio integration
  • 📊 Streams: RabbitMQ Streams with filtering support

📦 Installation

pip install weenspace-rabbitmq

🚀 Quick Start

Basic Publisher/Consumer

from weenspace_rabbitmq import (
    Environment,
    Connection,
    Publisher,
    Consumer,
    Message,
    ClassicQueueSpecification,
    ExchangeSpecification,
)

# Create environment and connection
environment = Environment(uri="amqp://guest:guest@localhost:5672/")
connection = environment.connection()

# Declare queue with dead letter support
management = connection.management()
queue_spec = ClassicQueueSpecification(
    name="my-queue",
    is_durable=True,
    dead_letter_exchange="dlx",
    dead_letter_routing_key="dlx-key",
    max_priority=10,  # Enable priority
)
management.declare_queue(queue_spec)

# Publish message
publisher = connection.publisher("/queues/my-queue")
publisher.publish(Message(body=b"Hello WeenSpace!"))

# Consume messages
def on_message(message):
    print(f"Received: {message.body}")
    message.accept()

consumer = connection.consumer("/queues/my-queue", handler=on_message)

Async Support

import asyncio
from weenspace_rabbitmq.asyncio import AsyncEnvironment

async def main():
    async with AsyncEnvironment(uri="amqp://localhost:5672/") as env:
        async with env.connection() as conn:
            publisher = await conn.publisher("/queues/my-queue")
            await publisher.publish(Message(body=b"Async message!"))

asyncio.run(main())

OAuth2 Authentication

from weenspace_rabbitmq import Environment, OAuth2Options

oauth = OAuth2Options(token="your_jwt_token")
environment = Environment(
    uri="amqp://localhost:5672/",
    oauth2_options=oauth
)

TLS/SSL Connection

from weenspace_rabbitmq import Environment, SslConfiguration

ssl_config = SslConfiguration(
    ca_cert="/path/to/ca.pem",
    client_cert="/path/to/client.pem",
    client_key="/path/to/client.key"
)
environment = Environment(
    uri="amqps://localhost:5671/",
    ssl_configuration=ssl_config
)

📚 Documentation

See examples folder for more detailed usage examples.

🔄 Migration from python-rabbitmq

# Old (python-rabbitmq)
# from python_rabbitmq import RabbitMQ

# New (weenspace-rabbitmq)
from weenspace_rabbitmq import Environment, Connection

📋 Requirements

  • Python 3.13+
  • RabbitMQ 4.x with AMQP 1.0 plugin enabled

📄 License

MIT License - Based on the official RabbitMQ AMQP Python Client

🙏 Credits

This library is based on the official RabbitMQ AMQP 1.0 Python client by the RabbitMQ team.

Metadata

Release files for weenspace-rabbitmq 0.1.0

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

Source distribution (sdist)

Source distribution for weenspace-rabbitmq 0.1.0
File Size Uploaded
weenspace_rabbitmq-0.1.0.tar.gz 111.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for weenspace-rabbitmq 0.1.0
File Interpreter ABI Platform
weenspace_rabbitmq-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 249.9 kB

Release files / weenspace_rabbitmq-0.1.0.tar.gz

Download URL weenspace_rabbitmq-0.1.0.tar.gz
Size 111.1 kB
Tags Source
SHA-256 checksum
How to use checksums
7ab7d7dd824cf046a719d28999128e7d4ddf20b34baff46f1dd7c237a047ec13
BLAKE2b-256 checksum
How to use checksums
b1fffef911b4109bf0bd9274e9efa11d68838838b10027ba65db41e7c9895682
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.13.3 Darwin/25.2.0

Release files / weenspace_rabbitmq-0.1.0-py3-none-any.whl

Download URL weenspace_rabbitmq-0.1.0-py3-none-any.whl
Size 138.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a2e683b9b999d0aa6454c013592def4f40c16b1455cf447548f32c5297d34f67
BLAKE2b-256 checksum
How to use checksums
5ec76170a2d193736a96938976fc37db01220ad13732494ff0c450bcb8946b8e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.13.3 Darwin/25.2.0

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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