Skip to main content

An asynchronous RabbitMQ client for Python

Project description

Fast Rabbit: Asynchronous RabbitMQ Client for Python

Fast Rabbit is an advanced, asynchronous RabbitMQ client designed to simplify the integration and management of RabbitMQ interactions within your Python applications. Leveraging the power of asyncio and aio_pika, Fast Rabbit provides a robust framework for message publishing and consuming, with an emphasis on simplicity, efficiency, and reliability.

Features

  • Asynchronous API: Built on top of asyncio, allowing for non-blocking message operations.
  • Easy Consumer Registration: Utilize decorators to effortlessly register message consumer coroutines.
  • Automatic Connection Management: Handles connection and channel lifecycle, including reconnections.
  • Flexible Routing: Incorporate a router similar to FastAPI for organised message handling based on queue names.

Installation

Install Fast Rabbit using pip:

pip install fast_rabbit

Quick Start

Publishing Messages

import asyncio
from fast_rabbit import FastRabbitEngine


RABBIT_MQ_URL = "amqp://user:password@localhost"
fast_rabbit = FastRabbitEngine(RABBIT_MQ_URL)

async def run_producer():
    for i in range(10):
        await fast_rabbit.publish("test_queue", f"Message {i}")
        print(f"Published message {i}")


if __name__ == "__main__":
    asyncio.run(run_producer())

Consuming Messages

Define your message handlers and register them as consumers for specific queues:

import asyncio
from fast_rabbit import FastRabbitEngine


RABBIT_MQ_URL = "amqp://user:password@localhost"
fast_rabbit = FastRabbitEngine(RABBIT_MQ_URL)

@fast_rabbit.subscribe("test_queue")
async def test_consumer(message: str):
    print(f"Received message: {message}")


if __name__ == "__main__":
    asyncio.run(fast_rabbit.run())

Documentation

For more detailed documentation, including API reference and advanced usage, please refer to the Fast Rabbit Documentation.

Contributing

Contributions are welcome! Please read our Contributing Guide for details on how to submit pull requests, report issues, and suggest improvements.

License

Fast Rabbit is released under the MIT License. See the LICENSE file for more details.


Fast Rabbit aims to provide a high-quality, easy-to-use asynchronous RabbitMQ client for the Python community. Whether you're building microservices, distributed systems, or just need a reliable way to handle message queues, Fast Rabbit is designed to meet your needs with minimal overhead and maximum efficiency.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fast_rabbit-0.1.8.tar.gz (8.2 kB view hashes)

Uploaded Source

Built Distribution

fast_rabbit-0.1.8-py3-none-any.whl (10.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page