snodra-messaging-rabbitmq
The RabbitMQ Streams event store for the Snodra messaging suite: publishers append a service's events to a super stream and every processor reads them as a single active consumer of its own name, on the layout the published RabbitMQ Streams wire rules fix.
Install
pip install snodra-messaging-rabbitmq
The distribution needs Python 3.12 or later and depends on snodra-messaging and rstream. The core
library never imports a stream client; this add-on is where it lives.
Use
import asyncio
import snodra
from snodra_rabbitmq import RabbitMQConfig, RabbitMQEventStore
async def main() -> None:
settings = snodra.Settings.from_env(service="orders-service")
events = RabbitMQEventStore(RabbitMQConfig.from_env())
try:
# The message store keeps the outbox, the processed-event markers and the dead letters;
# the event store is the super stream the relay publishes to and the processors read.
app = snodra.App(settings, store=snodra.MemoryStore(), event_store=events)
await app.run()
finally:
await events.close()
asyncio.run(main())
RabbitMQConfig() defaults to the host rabbitmq, port 5552 (5551 with TLS), vhost /, user and
password guest. RabbitMQConfig.from_env() reads SNODRA_RABBITMQ_HOSTS, SNODRA_RABBITMQ_PORT,
SNODRA_RABBITMQ_VIRTUAL_HOST, SNODRA_RABBITMQ_USERNAME, SNODRA_RABBITMQ_PASSWORD,
SNODRA_RABBITMQ_TLS and SNODRA_RABBITMQ_MANAGEMENT_URL; the timeout and offset settings keep
their defaults.
The library creates no stream. The infrastructure creates a super stream for the events source and,
for the dead-letter mode event-store, a plain stream for <source>.dlt:
rabbitmq-streams add_super_stream snodra.events --partitions 6
rabbitmqadmin declare queue --name snodra.events.dlt --type stream --durable true
A missing stream fails publishes (the relay retries) and subscriptions (they retry after a backoff).
The events source is a super stream; a segment is the partition stream's suffix (3 for
snodra.events-3), 0 for a plain stream, and a position is the offset in decimal. An event is one
AMQP 1.0 message: the JSON payload as its one data section, the event id as the message id, the key
as the x-routing-key annotation, every header an application property. A keyed event goes to the
partition of murmur3 x86_32 of its UTF-8 key (seed 104729, unsigned, modulo the partitions), so one
key from any Snodra publisher lands on one partition and keeps its order there. The stored offset is
the next one to read.
A subscription is the consumer name <service>.<processor> on every partition with
single-active-consumer=true and a random snodra-member per instance, so the broker spreads the
partitions and the management API can tell the instances apart. The add-on declares lag and
native-dead-letter always; with management_url it also declares replay, and only then does
admin() exist. It has no event browser and declares no browse.
Where the public specification leaves a choice, SPEC-GAPS.md records what this
library does; CLIENT-SPIKE.md records why the add-on drives rstream's
low-level client.
Test
The tests start RabbitMQ 4.4 with the stream and management plugins through Testcontainers (pinned by digest) and run the event-store conformance kit against it. Docker is required:
uv run pytest -q packages/snodra-messaging-rabbitmq/tests
Links
Metadata
Release files for snodra-messaging-rabbitmq 0.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| snodra_messaging_rabbitmq-0.6.0.tar.gz | 38.4 kB | With provenance | Details for snodra_messaging_rabbitmq-0.6.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| snodra_messaging_rabbitmq-0.6.0-py3-none-any.whl | Python 3 | none | any | Details for snodra_messaging_rabbitmq-0.6.0-py3-none-any.whl |
Total release size: 65.8 kB
Release files / snodra_messaging_rabbitmq-0.6.0.tar.gz
| Download URL | snodra_messaging_rabbitmq-0.6.0.tar.gz |
|---|---|
| Size | 38.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5cebb2452fba72b8ef1533095d5f70ef89d4d52f6db23b8e3468000e81a94ad1
|
|
BLAKE2b-256 checksum How to use checksums |
e872af9bbcf9fc783500682fb35562753f15d8a2f28030d6f775d46be1a82166
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logRelease files / snodra_messaging_rabbitmq-0.6.0-py3-none-any.whl
| Download URL | snodra_messaging_rabbitmq-0.6.0-py3-none-any.whl |
|---|---|
| Size | 27.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3ba3eee8fa4105be0017221d82a10ad6b291e2a4dcd0e5ae91f0930dded3fa70
|
|
BLAKE2b-256 checksum How to use checksums |
8a806af1f25b3efc30459ac9e6bcfb7b9115842506e5e7277f4d18e36fab6c40
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logSecurity for snodra-messaging-rabbitmq 0.6.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for snodra_messaging_rabbitmq-0.6.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.