ruststream-amqp connects a RustStream service to an AMQP 1.0 broker over
fe2o3-amqp. One crate serves the whole family: ActiveMQ
Artemis and Classic, RabbitMQ 4.x over AMQP 1.0, Azure Service Bus and Event Hubs, Amazon MQ,
Solace, Apache Qpid and IBM MQ. For RabbitMQ over AMQP 0.9.1, use
ruststream-lapin. Handlers, routing, codecs and
middleware come from the framework; this crate is the transport.
Features
- Settlement as dispositions:
ackisaccepted, a retry ismodified, a drop isrejected, so the broker's own dead-letter policy applies. - Explicit addressing: queues (anycast), topics (multicast) or a raw address, with credit as flow control.
- Retry caps and dead letters declared where the handler is mounted.
- Batches assembled on the client.
- Request/reply over
reply-toandcorrelation-id, and transactions behind thetransactionfeature. - Plain AMQP messages for non-Rust peers: well-known headers ride the
propertiessection. - AsyncAPI that names the protocol
amqp1, behind theasyncapifeature. - Tests without a server: handlers run against an in-process AMQP broker.
Install
[]
= { = "0.7", = ["macros", "json"] }
= "0.7"
= { = "1", = ["derive"] }
[]
= { = "0.7", = ["testing"] }
Optional features: TLS for amqps:// (rustls or native-tls), transaction and asyncapi.
Write a service
use *;
use ;
async
#[ruststream::app] generates main, so the binary understands run and asyncapi gen.
Test it
TestApp runs the service's own app with AmqpBroker in process, with no server.
use TestApp;
let tb = start.await?;
tb.
.message
.to
.publish
.await?;
tb.
.subscriber
.assert_called_once
.with
.settled;
tb.
.
.assert_called_once
.with;
Documentation
- Getting started - installation and a first service against a local ActiveMQ Artemis.
- Guides - queues and topics, acknowledgement, retries and dead letters, request-reply, transactions, testing and a production broker.
- Components - one page per part of the crate: the broker, subscriptions, dispositions, publishing, request-reply, transactions, the AsyncAPI bindings and testing.
- Architecture - how AMQP 1.0 works and how the crate sits between
fe2o3-amqpand the runtime. - Benchmarks - what the crate costs over the raw client.
- API reference - every item on docs.rs.
- The framework: https://powersemmi.github.io/ruststream/latest/
Minimum supported Rust version
The MSRV is 1.95, edition 2024.
Contributing
See CONTRIBUTING.md.
License
Licensed under the Apache-2.0 license.