Skip to main content

Crate ruststream_lapin

Crate ruststream_lapin 

Source
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)) sends basic.nack with requeue
  • drop (nack(false)) sends basic.reject without 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 testing feature.

Structs§

ConfirmsPublisher
A publisher that awaits broker confirms for every message.
DirectReplyTo
Redirects each reply of a #[subscriber(.., publish(..))] handler to the requester’s private reply-to address, echoing its correlation id.
FieldTable
A Map<String, AMQPValue>
LapinBroker
A RabbitMQ broker backed by lapin.
LapinMessage
One AMQP delivery, settled with the protocol’s native acknowledgement frames.
LapinPublisher
Fire-and-forget publisher on the broker’s shared publish channel.
LapinRequester
A request/reply client over RabbitMQ direct reply-to.
LapinSubscriber
A consumer on one queue, yielding LapinMessage deliveries.
RabbitExchange
Describes the exchange side of a RabbitQueue binding.
RabbitQueue
Describes one queue subscription: the queue, its expected settings, and its bindings.
ServerTxPublisher
A publisher backed by AMQP server transactions (tx.select / tx.commit / tx.rollback).

Enums§

AMQPValue
Enumeration referencing the possible AMQP values depending on the types
AmqpError
Errors returned by LapinBroker and the types it hands out.
Delay
How a subscription handles retry_after / nack_after delays.
QueueType
The queue implementation selected at declaration time.

Constants§

PARTITION_KEY_HEADER
Header carrying a message’s partition key, read by Partitioned for keyed worker lanes.