Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
L

lapin

> 开发工具
Open source

AMQP client library in Rust, with a clean, futures based API

1.2K stars0 likes1 views
WebsiteGitHub

About

AMQP client library in Rust, with a clean, futures based API

Lapin implements the AMQP 0-9-1 specification on top of an async I/O layer. It is runtime-agnostic: the same code works with tokio (default), smol, or async-global-executor.

For full API documentation see docs.rs/lapin.

Quick start

…

Automatic connection recovery

Pass .enable_auto_recover() in ConnectionProperties to have lapin automatically reconnect and replay exchanges, queues, bindings, and consumers after a network failure:

use lapin::ConnectionProperties;

let props = ConnectionProperties::default().enable_auto_recover();

After catching a recoverable error on a channel, call channel.wait_for_recovery(error).await to block until recovery is complete.

Feature flags

Async runtime (pick exactly one)

Flag Notes
tokio (default) Requires a running Tokio runtime
smol Uses the smol executor
async-global-executor Uses async-global-executor

TLS backend (pick at most one)

Flag Notes
rustls (default) TLS via rustls
native-tls TLS via the platform native library
openssl TLS via OpenSSL

Rustls certificate store (when rustls is active)

Flag Notes
rustls-platform-verifier (default) Platform trust store
rustls-native-certs Native root certificates
rustls-webpki-roots-certs Bundled webpki root set

Rustls crypto provider (at least one required)

Flag Notes
rustls--aws_lc_rs (default) Uses aws-lc-rs
rustls--ring Uses ring (more portable)

Miscellaneous

Flag Notes
hickory-dns Hickory DNS resolver (avoids spurious network hangs)
codegen Force protocol code regeneration at build time
verbose-errors More detailed AMQP parser error messages

Custom runtimes

Lapin can use any runtime by supplying an async_rs::Runtime value:

use lapin::{Connection, ConnectionProperties, Result};

async fn connect_with_custom_runtime() -> Result {
    let runtime = async_rs::Runtime::tokio_current();
    let conn = Connection::connect_with_runtime(
        "amqp://localhost",
        ConnectionProperties::default(),
        runtime,
    ).await?;
    drop(conn);
    Ok(())
}

See async-rs for available runtime wrappers.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Rustamqpamqp-clientamqp0-9-1async

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category开发工具
PricingOpen source

> Related tools

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具