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-queue

🚀 Quick Start

Basic Publisher/Consumer

from weenspace_queue 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_queue.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_queue import Environment, OAuth2Options

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

TLS/SSL Connection

from weenspace_queue 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-queue)
from weenspace_queue 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-queue 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-queue 0.1.0
File Size Uploaded
weenspace_queue-0.1.0.tar.gz 13.3 kB Details

Built distribution (wheel)

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

Total release size: 30.6 kB

Release files / weenspace_queue-0.1.0.tar.gz

Download URL weenspace_queue-0.1.0.tar.gz
Size 13.3 kB
Tags Source
SHA-256 checksum
How to use checksums
2197092ac4c0740cc9367b79c0657f1b93164b2005d16b3df886e6672f801ef6
BLAKE2b-256 checksum
How to use checksums
a80e043299ed0a80ee9a63cba309e0dbe64c10dc6781c6dadd40bffb7edec3b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

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

Download URL weenspace_queue-0.1.0-py3-none-any.whl
Size 17.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
12596e17a45f34549c3a3386421f7beabd7a96e7f4981517cf445cef111f8c22
BLAKE2b-256 checksum
How to use checksums
ed68d12b09fdb56baab9f697960389b8d1651b6608701dfe0ac73f689277535e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

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