This release is a pre-release and may not be stable for production use.
benzene-rabbitmq
Host Benzene Python handlers on RabbitMQ —
a self-hosted consumer and a RabbitMQ-publish outbound client — the same handlers, no rewrite. Depends
only on benzene-core.
pip install benzene-rabbitmq # the binding + testing helpers
pip install "benzene-rabbitmq[rabbitmq]" # + pika for the real clients
from benzene.core import application_from, build_application
from benzene.rabbitmq import RabbitMqConsumerApp, RabbitMqMessageSender, run_consumer_loop
# Inbound: one delivery -> one pipeline invocation -> one scope; ack/log, no reply.
definition, _ = build_application(OrdersStartUp)
app = RabbitMqConsumerApp(application_from(definition))
await run_consumer_loop(app, channel, queue="orders") # channel: a pika channel
# Outbound: publish to an exchange, Benzene topic carried in the `topic` header.
sender = RabbitMqMessageSender("orders-events", host="localhost")
await sender.send_message("orders:created", order, headers={"x-correlation-id": "abc"})
- Consumer — the Benzene topic comes from the
topicheader carried in the delivery's AMQPproperties.headers(the cross-port convention); the other headers are the Benzene headers (UTF-8), the body is the JSON body. One delivery is one scope; there is no response channel, so the result is acknowledge/log only —run_consumer_loopacks the delivery on success (at-least-once) and nacks a failed one for redelivery. A poison delivery can never crash the loop. - Outbound —
RabbitMqMessageSenderimplements thebenzene.core.MessageSenderport overpika(optional extra), forwarding the header dictionary onto the AMQPproperties.headersso correlation/trace propagation rides across the hop.
The binding is duck-typed against pika, so decode, dispatch, and publish are exercised in memory with
fakes — no broker, no SDK. Test through benzene.rabbitmq.testing (a native-delivery builder + a test
host) or the shared harness (create_test_host(StartUp).build_rabbitmq() + send_rabbitmq) — see the
runnable examples/rabbitmq_orders/. Mirrors .NET's Benzene.RabbitMq, and contributes the
benzene.rabbitmq subpackage to the shared benzene namespace.
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 benzene_rabbitmq-0.1.0b1.tar.gz.
File metadata
- Download URL: benzene_rabbitmq-0.1.0b1.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
42241f3d1f38d34fa03a4c8fcb2e2ff0f7a85d7a7e7e81b42abd840291ecd9fa
|
|
| MD5 |
3f37878d0fe074cd9064a572827c5d89
|
|
| BLAKE2b-256 |
dd90fecc26059be343dec03c261faa23dad8685e0065609b47e5c83932eb07de
|
Provenance
The following attestation bundles were made for benzene_rabbitmq-0.1.0b1.tar.gz:
Publisher:
release.yml on daniellepelley/benzene-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
benzene_rabbitmq-0.1.0b1.tar.gz -
Subject digest:
42241f3d1f38d34fa03a4c8fcb2e2ff0f7a85d7a7e7e81b42abd840291ecd9fa - Sigstore transparency entry: 2467247244
- Sigstore integration time:
-
Permalink:
daniellepelley/benzene-python@7f3c0d2abeeb3782a82a8e2621ee8b431bf02ca8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/daniellepelley
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7f3c0d2abeeb3782a82a8e2621ee8b431bf02ca8 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file benzene_rabbitmq-0.1.0b1-py3-none-any.whl.
File metadata
- Download URL: benzene_rabbitmq-0.1.0b1-py3-none-any.whl
- Upload date:
- Size: 10.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
93c3ef19f5d094a6c52707ba2a7d65a819580131e05a96ec0380a13fb9520cca
|
|
| MD5 |
0ea14c66de02e3c2c25273f50ddb5fef
|
|
| BLAKE2b-256 |
ce635ef241846a328fd273bfb8c22b7575265a18e0e54ed9ecc232c6185425e6
|
Provenance
The following attestation bundles were made for benzene_rabbitmq-0.1.0b1-py3-none-any.whl:
Publisher:
release.yml on daniellepelley/benzene-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
benzene_rabbitmq-0.1.0b1-py3-none-any.whl -
Subject digest:
93c3ef19f5d094a6c52707ba2a7d65a819580131e05a96ec0380a13fb9520cca - Sigstore transparency entry: 2467236276
- Sigstore integration time:
-
Permalink:
daniellepelley/benzene-python@7f3c0d2abeeb3782a82a8e2621ee8b431bf02ca8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/daniellepelley
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7f3c0d2abeeb3782a82a8e2621ee8b431bf02ca8 -
Trigger Event:
workflow_dispatch
-
Statement type: