RabbitMQ app framework
Project description
RabbitBus
Feel RabbitMQ like HTTP
- Custom CorrelationManagers
- Regexp roures
Installation
RabbitBus requires Python 3.6 >, aioamqp.
Install the dependencies and library.
$ pip install git+https://github.com/shadrus/rabbitbus.git
Example:
import asyncio
import logging
from rabbitbus.manager import DatabusApp, Configuration
from rabbitbus.requests import AmqpRequest
from rabbitbus.responses import AckResponse
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)
ch.setFormatter(formatter)
logger.addHandler(ch)
async def my_view(request: AmqpRequest):
# Write your code here
return AckResponse()
def serve():
loop = asyncio.get_event_loop()
# Inherit from CorrelationManager for custom correlation storages
app = DatabusApp(conf=Configuration())
app.add_route(r'^CASH_REGISTER_EQUIPMENTS[a-zA-Z_]{4}$', my_view, as_list=True)
app.start(loop)
if __name__ == '__main__':
serve()
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
rabbitbus-0.0.5.tar.gz
(5.5 kB
view hashes)
Built Distribution
Close
Hashes for rabbitbus-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b256c70e1721f7a989564c31c4f67d54d3b3a9418c0a79869d54005f611ee2b0 |
|
MD5 | 15d43be8ef69d7aa3010bb5a258708f3 |
|
BLAKE2b-256 | ff502a772ef08a7f1f5bed3e7c2952a94f79f0c3b1077418c48b69f656c96b42 |