https://github.com/asahaf/rabbitleap
Simple RabbitMQ consuming framework
https://github.com/asahaf/rabbitleap
consumer consuming-messages framework messaging rabbitmq rabbitmq-consumer
Last synced: 3 months ago
JSON representation
Simple RabbitMQ consuming framework
- Host: GitHub
- URL: https://github.com/asahaf/rabbitleap
- Owner: asahaf
- License: mit
- Created: 2018-09-18T06:35:23.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-06-02T00:34:04.000Z (almost 5 years ago)
- Last Synced: 2025-10-13T10:16:21.363Z (6 months ago)
- Topics: consumer, consuming-messages, framework, messaging, rabbitmq, rabbitmq-consumer
- Language: Python
- Size: 74.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
- Changelog: HISTORY.rst
- Contributing: CONTRIBUTING.rst
- License: LICENSE
Awesome Lists containing this project
README
.. image:: https://travis-ci.org/asahaf/rabbitleap.svg?branch=master
:target: https://travis-ci.org/asahaf/rabbitleap
##########
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
============
.. code-block:: console
$ pip install rabbitleap
Hello, world
============
.. code-block:: python
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