Simple RabbitMQ consuming framework
Project description
RabbitLeap
RabbitLeap is a simple RabbitMQ consuming framework. It’s built on top of Pika, a RabbitMQ client library for Python.
Features
- Automatically recovers from connection failures
- Configurable retry policy for handing failures
- Automatically route messages to handlers, based on custom logic and different message properties
Installation
$ pip install rabbitleap
Hello, world
from rabbitleap.consumer import Consumer from rabbitleap.handling import MessageHandler class RabbitEatHandler(MessageHandler): def handle(self): print('rabbit eat: {}'.format(self.envelope.payload.decode('utf-8'))) consumer_queue_name = 'consumer_queue' amqp_url = r'amqp://guest:guest@localhost:5672/%2f' consumer = Consumer(amqp_url=amqp_url, queue_name=consumer_queue_name) # route message of type `rabbit.eat` to RabbitEatHandler consumer.add_handler(r'rabbit\.eat', RabbitEatHandler) try: consumer.start() except KeyboardInterrupt: consumer.stop()
Documentation
Documentation and resources are available at https://rabbitleap.readthedocs.io
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
rabbitleap-0.1.1.tar.gz
(28.3 kB
view hashes)
Built Distribution
Close
Hashes for rabbitleap-0.1.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39b0177c8a3c81768098fd62e66bcc1577434a2536e5ef0271565475167c5874 |
|
MD5 | b424b6b2da7af619924fc8715c6eaf39 |
|
BLAKE2-256 | 80a06c24fdb17c9aebac71efe54eea8616f985bec5ca35d050f958ade4213aa0 |