RabbitMQ pub-sub for the Pico ecosystem: @consumer methods and @publisher clients over aio-pika.
Project description
pico-rabbitmq
RabbitMQ pub-sub for the pico ecosystem: @consumer methods and declarative @publisher clients over aio-pika. Covers what pico-celery does not: events, fan-out, topic routing.
Installation
pip install pico-rabbitmq
Quick start
rabbitmq:
url: amqp://guest:guest@rabbit.internal/
Consume — a component method per queue, JSON body decoded for you:
from pico_ioc import component
from pico_rabbitmq import consumer
@component
class OrderProjections:
@consumer("orders-projection", exchange="events", routing_key="orders.*")
async def on_order_event(self, message: dict):
...
Publish — stubs, like a pico-httpx client:
from pico_rabbitmq import publisher, publish
@publisher
class OrderEvents:
@publish(exchange="events", routing_key="orders.created")
def order_created(self, message): ...
Semantics:
- Consumers and publishers run on a dedicated background loop — works in sync scripts, FastAPI apps and workers alike, no lifespan wiring.
- Each message resolves its component through the container (prototype scope = fresh instance per message).
- Ack on success; on exception the message is logged and rejected without requeue (configure a dead-letter exchange to keep failures).
- Sync publish stubs block until the broker confirms; async stubs await it.
- Queues and named exchanges are declared durable; the connection closes on container shutdown.
Documentation
Full documentation: https://dperezcabrera.github.io/pico-rabbitmq/
License
MIT
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pico_rabbitmq-0.1.0.tar.gz.
File metadata
- Download URL: pico_rabbitmq-0.1.0.tar.gz
- Upload date:
- Size: 20.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
377da5a862700bd4fc946b0a49ed09423394eddbea08ae7d48db9e286133d631
|
|
| MD5 |
2d3ac305966a9f3491446c505f57efd9
|
|
| BLAKE2b-256 |
d973d02c3ad223b5fa9da452490ddd60e899952d651bedbafde1afdbc2c6b840
|
Provenance
The following attestation bundles were made for pico_rabbitmq-0.1.0.tar.gz:
Publisher:
publish-to-pypi.yml on dperezcabrera/pico-rabbitmq
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pico_rabbitmq-0.1.0.tar.gz -
Subject digest:
377da5a862700bd4fc946b0a49ed09423394eddbea08ae7d48db9e286133d631 - Sigstore transparency entry: 2137628243
- Sigstore integration time:
-
Permalink:
dperezcabrera/pico-rabbitmq@e8f9173803896e13659d6637248f0fb11d024a77 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/dperezcabrera
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@e8f9173803896e13659d6637248f0fb11d024a77 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pico_rabbitmq-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pico_rabbitmq-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c12ec51ed8fc0985eded5eb5e7b189a0746a942884ef750bf03399e187d7f0e0
|
|
| MD5 |
c032597598a27809d49dc14518cee8ce
|
|
| BLAKE2b-256 |
26d05523651e2ca5cfb5b6f95882a1c4e06f062e677e7e0d3a1ca2bbd5c56cfd
|
Provenance
The following attestation bundles were made for pico_rabbitmq-0.1.0-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on dperezcabrera/pico-rabbitmq
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pico_rabbitmq-0.1.0-py3-none-any.whl -
Subject digest:
c12ec51ed8fc0985eded5eb5e7b189a0746a942884ef750bf03399e187d7f0e0 - Sigstore transparency entry: 2137628275
- Sigstore integration time:
-
Permalink:
dperezcabrera/pico-rabbitmq@e8f9173803896e13659d6637248f0fb11d024a77 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/dperezcabrera
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@e8f9173803896e13659d6637248f0fb11d024a77 -
Trigger Event:
release
-
Statement type: