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

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.8.0
File Size Uploaded Provenance Actions
snodra_messaging_rabbitmq-0.8.0.tar.gz 38.5 kB With provenance Details for snodra_messaging_rabbitmq-0.8.0.tar.gz

Built distribution (wheel)

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

Total release size: 65.9 kB

Release files / snodra_messaging_rabbitmq-0.8.0.tar.gz

Download URL snodra_messaging_rabbitmq-0.8.0.tar.gz
Size 38.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ad30aeb71d0aa4ceeaac04ff1c3e1fa05dbed1d33920541a989a694cf5ddac6d
BLAKE2b-256 checksum
How to use checksums
599c795135d5933a69f8b5955db44a0bbddb10e34ddfba88272b00ec47b56695
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 28, 2026.

Transparency log

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

Download URL snodra_messaging_rabbitmq-0.8.0-py3-none-any.whl
Size 27.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8c25707cca2cd655e2d01066239bc7e9c2458301c2f5ec2540a8ac5760e1e120
BLAKE2b-256 checksum
How to use checksums
19e97a69ebc4946c12c33cdb195620dde56612453b155650e69ea3257190f862
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 28, 2026.

Transparency log

Security for snodra-messaging-rabbitmq 0.8.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.

Select from 2 files

Attestation for snodra_messaging_rabbitmq-0.8.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 28, 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