Skip to main content

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

Metadata

Release files for snodra-messaging-rabbitmq 0.12.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for snodra-messaging-rabbitmq 0.12.1
File Size Uploaded Provenance Actions
snodra_messaging_rabbitmq-0.12.1.tar.gz 38.5 kB With provenance Details for snodra_messaging_rabbitmq-0.12.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for snodra-messaging-rabbitmq 0.12.1
File Interpreter ABI Platform Actions
snodra_messaging_rabbitmq-0.12.1-py3-none-any.whl Python 3 none any Details for snodra_messaging_rabbitmq-0.12.1-py3-none-any.whl

Total release size: 65.9 kB

Release files / snodra_messaging_rabbitmq-0.12.1.tar.gz

Download URL snodra_messaging_rabbitmq-0.12.1.tar.gz
Size 38.5 kB
Tags Source
SHA-256 checksum
How to use checksums
882b5ee944f1cd165d0cd10bb2e289851be2e78b76507511db97a3e6ab729821
BLAKE2b-256 checksum
How to use checksums
7a978c1a4edcb80162b723437e72a314066311addc4784b7676e070a7758f818
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 29, 2026.

Transparency log

Release files / snodra_messaging_rabbitmq-0.12.1-py3-none-any.whl

Download URL snodra_messaging_rabbitmq-0.12.1-py3-none-any.whl
Size 27.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2d52ddcf2be9c500413726398936d580cb201925a28e4bca1a408f45ed80f899
BLAKE2b-256 checksum
How to use checksums
7609d520f2a19fdbd85873afd2170e18ae47a4d35716eeea8274c440c134c9ae
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 29, 2026.

Transparency log

Security for snodra-messaging-rabbitmq 0.12.1

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.

Select from 2 files

Attestation for snodra_messaging_rabbitmq-0.12.1.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 29, 2026.

Transparency log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page