Skip to main content

An AsyncIO RabbitMQ Client Library

Project description

aiorabbit is an AsyncIO RabbitMQ client for Python 3.

Version Build Status Coverage License

Project Goals

  • To create a simple, robust RabbitMQ client library for AsyncIO development in Python 3

  • To make use of new features and capabilities in Python 3.7+

  • To abstract away the AMQP channel and use it only as a protocol coordination mechanism inside the client

  • To provide built-in support for multiple brokers and automatic reconnection

Example Use

The following demonstrates an example of the intended behavior for the library:

import time
import uuid

import aiorabbit

RABBITMQ_URL = 'amqps://guest:guest@localhost:5672/%2f'


async def main():
    client = await aiorabbit.connect(RABBITMQ_URL)
    await client.confirm_select()

    response = await client.publish(
        'exchange', 'routing-key', 'message-body', app_id='example',
        message_id=str(uuid.uuid4()), timestamp=int(time.time()),
        mandatory=True)

    if not response.ok:
        print('Publishing failure: {!r} {!r}'.format(
            response.error, response.message))

if __name__ == '__main__':
    asyncio.run(main())

Documentation

http://aiorabbit.readthedocs.org

License

BSD

Python Versions Supported

3.7+

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

aiorabbit-0.1.0a1.tar.gz (14.0 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page