Skip to content

Latest commit

 

History

History
30 lines (22 loc) · 843 Bytes

amqp.rst

File metadata and controls

30 lines (22 loc) · 843 Bytes

AMQP Adapter

While the core rabbitpy API strives to provide an easy to use, Pythonic interface for RabbitMQ, some developers may prefer a less opinionated AMQP interface. The :pyrabbitpy.AMQP adapter provides a more traditional AMQP client library API seen in libraries like pika.

0.26

Example

The following example will connect to RabbitMQ and use the :pyrabbitpy.AMQP adapter to consume and acknowledge messages.

import rabbitpy

with rabbitpy.Connection() as conn:
    with conn.channel() as channel:
        amqp = rabbitpy.AMQP(channel)

        for message in amqp.basic_consume('queue-name'):
            print(message)

API Documentation

rabbitpy.AMQP