API Reference

aio-pika

An asyncio AMQP client for RabbitMQ built on aiormq, with robust connections and pools.

Official Documentation ↗
CompatibilityThis documentation covers version v9.4. Check the official docs for the latest API surface.

Installation

pippip install aio-pika

Methods

aio-pika offers async publish and consume with automatic reconnection and channel pooling.

Key Features

  • Robust connections that auto-reconnect
  • Async queues and exchanges
  • Channel and connection pools

Usage Notes

Pin a version and check the official docs for the API surface you depend on before upgrading.

Errors

The official API reference declares the following error types:

API reference evidence

Fetched from official sources on 2026-11-08T16:03:08.4363995+08:00 via WebFetch 官方文档站(apidoc 入口回退为官网首页);签名取自官方仓库 aio_pika 源码 docstring.

FAQ

How does process() help?
The async context manager acks on success and rejects on exception, making acknowledgement implicit and harder to get wrong.
Should I create a connection per request?
No. Reuse one robust connection and pool channels; connect_robust handles reconnection transparently.
How do I publish with confirms?
Enable publisher confirms on the channel and await the returned delivery tag to guarantee broker acceptance.