dtmrs 0.5.0

Distributed transaction manager in Rust: SAGA / TCC / two-phase messaging / XA / workflow, over HTTP and gRPC, embeddable as a library
Documentation
[package]
name = "dtmrs"
version.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
homepage.workspace = true
authors.workspace = true
rust-version.workspace = true
keywords.workspace = true
categories.workspace = true
description = "Distributed transaction manager in Rust: SAGA / TCC / two-phase messaging / XA / workflow, over HTTP and gRPC, embeddable as a library"
readme = "README.md"

[[bin]]
name = "dtmrs"
path = "src/main.rs"
# 只装库的人(比如业务侧只要屏障)不需要这个二进制,也就不必背上
# axum / tonic 那一堆依赖
required-features = ["server"]

[features]
# 默认给「我要跑协调器」这个最常见的诉求
default = ["server"]

# 事务协调器(TC)本体 + 那个 dtmrs 二进制
server = [
    "dep:dtmrs-server", "dep:dtmrs-store",
    "dep:tokio", "dep:anyhow", "dep:tracing", "dep:tracing-subscriber",
    "dep:axum", "dep:serde", "dep:serde_json",
]
# TC 的 gRPC 接口 + 调 grpc:// 分支
grpc = ["server", "dep:tonic", "dtmrs-server/grpc"]
# Redis 存储后端 —— 秒杀那类流量尖峰用。⚠ 持久性弱于 SQL,见文档
redis = ["server", "dtmrs-server/redis"]
# 业务侧(RM)要的子事务屏障 —— 只接入不部署 TC 的话,单开这个就够
barrier = ["dep:dtmrs-barrier"]
# 业务数据在 Redis 里(秒杀库存那类)时的屏障。没有 SQL 本地事务可加入,
# 原子性改由 Lua 脚本提供
barrier-redis = ["barrier", "dtmrs-barrier/redis"]
# 业务侧(RM)的 XA 助手
xa = ["dep:dtmrs-xa"]

# 全都要
full = ["server", "grpc", "barrier", "barrier-redis", "xa", "redis"]

[dependencies]
dtmrs-core = { path = "../dtmrs-core", version = "0.5.0" }
dtmrs-server = { path = "../dtmrs-server", version = "0.5.0", optional = true, default-features = false }
dtmrs-store = { path = "../dtmrs-store", version = "0.5.0", optional = true }
dtmrs-barrier = { path = "../dtmrs-barrier", version = "0.5.0", optional = true }
dtmrs-xa = { path = "../dtmrs-xa", version = "0.5.0", optional = true }

# 只有二进制用得上
tokio = { workspace = true, optional = true }
anyhow = { workspace = true, optional = true }
tracing-subscriber = { workspace = true, optional = true }
axum = { workspace = true, optional = true }
serde = { workspace = true, optional = true }
serde_json = { workspace = true, optional = true }
tracing = { workspace = true, optional = true }
tonic = { workspace = true, optional = true }

[package.metadata.docs.rs]
all-features = true