Expand description
RabbitMQ / AMQP 0.9.1 broker for the
RustStream messaging framework, backed by
lapin.
§Transport model
A subscription consumes one queue; RabbitQueue describes the queue and its bindings, and
the bare-string #[subscriber("orders")] form consumes the queue named orders. On the
publish side OutgoingMessage::name is the routing key, sent
to the publisher’s exchange (the default exchange unless configured, where the routing key
addresses the queue with that name).
Settlement uses the protocol natively, with no republish tricks:
- ack sends
basic.ack - retry (
nack(true)) sendsbasic.nackwith requeue - drop (
nack(false)) sendsbasic.rejectwithout requeue, dead-lettering when the queue has a dead-letter exchange
§Lazy startup
LapinBroker::new is synchronous and I/O-free, so a service composes with the synchronous
#[ruststream::app] builder; the real network work happens in the idempotent async
Broker::connect, called once by the runtime at startup. Publishers handed out before that
resolve the shared connection on first use.
§Topology
Descriptors describe the EXPECTED topology; nothing is created on the broker by default,
because managing infrastructure is the user’s job. Declaration is a per-broker opt-in:
LapinBroker::declare_topology.
Modules§
- context
- Per-delivery context fields exposed to handlers.
- testing
- In-process test broker, behind the
testingfeature.
Structs§
- Confirms
Publisher - A publisher that awaits broker confirms for every message.
- Direct
Reply To - Redirects each reply of a
#[subscriber(.., publish(..))]handler to the requester’s private reply-to address, echoing its correlation id. - Field
Table - A Map<String, AMQPValue>
- Lapin
Broker - A
RabbitMQbroker backed bylapin. - Lapin
Message - One AMQP delivery, settled with the protocol’s native acknowledgement frames.
- Lapin
Publisher - Fire-and-forget publisher on the broker’s shared publish channel.
- Lapin
Requester - A request/reply client over
RabbitMQdirect reply-to. - Lapin
Subscriber - A consumer on one queue, yielding
LapinMessagedeliveries. - Rabbit
Exchange - Describes the exchange side of a
RabbitQueuebinding. - Rabbit
Queue - Describes one queue subscription: the queue, its expected settings, and its bindings.
- Server
TxPublisher - A publisher backed by AMQP server transactions (
tx.select/tx.commit/tx.rollback).
Enums§
- AMQP
Value - Enumeration referencing the possible AMQP values depending on the types
- Amqp
Error - Errors returned by
LapinBrokerand the types it hands out. - Delay
- How a subscription handles
retry_after/nack_afterdelays. - Queue
Type - The queue implementation selected at declaration time.
Constants§
- PARTITION_
KEY_ HEADER - Header carrying a message’s partition key, read by
Partitionedfor keyed worker lanes.