Skip to main content

aioamqp-consumer-best

PyPI version PyPI - Python Version Build Status codecov

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())

Metadata

Release files for aioamqp-consumer-best 2.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aioamqp-consumer-best 2.4.0
File Size Uploaded
aioamqp-consumer-best-2.4.0.tar.gz 11.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aioamqp-consumer-best 2.4.0
File Interpreter ABI Platform
aioamqp_consumer_best-2.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 22.6 kB

Release files / aioamqp-consumer-best-2.4.0.tar.gz

Download URL aioamqp-consumer-best-2.4.0.tar.gz
Size 11.4 kB
Tags Source
SHA-256 checksum
How to use checksums
0bb6cff9c369c9a501bbceb42c78ea9714d6e1cc19281f011a246eec91f7bb03
BLAKE2b-256 checksum
How to use checksums
8fcf3a4b94c2295aac02a1552906be458d362c52b660ca638c7e563cef7993f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Release files / aioamqp_consumer_best-2.4.0-py3-none-any.whl

Download URL aioamqp_consumer_best-2.4.0-py3-none-any.whl
Size 11.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
137be99e3fd5dcbc5409dcb5b0d4795ff7d3e20470704f7c1fe27da813f3d176
BLAKE2b-256 checksum
How to use checksums
1d17026450f843518f298aaaa95965c316815ddd5b038e42188274e6c270342f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Release history Release notifications | RSS feed

This release

2.4.0 This release

2 release files

2.3.0

2 release files

2.2.2

2 release files

2.2.1

2 release files

2.2.0

2 release files

2.1.0

2 release files

2.0.0

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page