This project follows the AMQP 0.9.1 specifications, targeting especially RabbitMQ.
Features
- hickory-dns: use hickory-dns for domain name resolution to avoid spurious network hangs
- unstable: enable access to the experimental reconnection features
- codegen: force code generation (default to pregenerated sources)
- vendored-openssl: use a vendored openssl version instead of the system one (when using openssl backend)
- verbose-errors: enable more verbose errors in the AMQP parser
TLS backends
- native-tls
- openssl
- rustls (default)
Rustls certificates store
- rustls-native-certs (default)
- rustls-webpki-roots-certs
Warning about crypto backends for rustls
A crypto implementation must be enabled in rustls using feature flags. We mimic what rustls does, providing one feature flag per implementation and enabling the same as rustls by default. Available options are:
rustls--aws_lc_rs(default)rustls--ring
Integration with third-party runtimes
Lapin can use any runtime of your choice by passing it to the ConnectionProperties.
You can configure the executor to use through executor-trait.
You can configure the reactor to use through reactor-trait.
There are implementations for tokio, async-std and others.
Experimental automatic reconnection
WARNING: use at your own risk, this feature is not considered stable yet. Expect some bugs and please help by reporting them.
There is experimental support for recovering connection after errors.
To enable this, you need to enable the unstable feature for lapin, and add it to the ConnectionProperties:
let recovery_config = full;
let properties = default.with_experimental_recovery_config;
// connect using properties.
You can then check if an error can be recovered and wait for recovery:
channel.wait_for_recovery.await?;
Example
use StreamExt;
use ;
use info;