Consumer utility for AMQP
Project description
aioamqp-consumer-best
Usage
import asyncio from typing import List from aioamqp_consumer_best import ( ConnectionParams, Consumer, Exchange, Message, ProcessBulk, Queue, QueueBinding, ToBulks, load_json, ) async def callback(messages: List[Message]) -> None: print(messages) consumer = Consumer( middleware=( load_json | ToBulks(max_bulk_size=10, bulk_timeout=3.0) | ProcessBulk(callback) ), prefetch_count=10, queue=Queue( name='test-queue', bindings=[ QueueBinding( exchange=Exchange('test-exchange'), routing_key='test-routing-key', ), ], ), connection_params=[ # Round robin ConnectionParams(), ConnectionParams.from_string('amqp://user@rmq-host:5672/'), ], ) asyncio.run(consumer.start())
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
Built Distribution
Close
Hashes for aioamqp-consumer-best-2.3.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0ea552c546597447218b929299015a860e0f1535535c0ee15436b74cc95e2ef |
|
MD5 | 56fc2c92d80937631f00eb88921c5863 |
|
BLAKE2-256 | 64fc1f09e2c69082683277b7228b91d30f9f4029a982ad46aa8f34662bcad29b |
Close
Hashes for aioamqp_consumer_best-2.3.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e70a176d7fbb4b656dce81c99836369b7c8c1c70befc16c908e6191a7131204b |
|
MD5 | 87508b73fb6668e73beae3f59c586031 |
|
BLAKE2-256 | 8b75043a1d5a1515efa826e49ca6f9576c5e687889cec9cbc3d27f2f6aa24d21 |