dtm_client
Rust client library for DTM (Distributed Transaction Manager): https://dtm.pub/
This crate targets feature parity with the upstream Go reference client:
- https://github.com/dtm-labs/client (baseline:
main@4be5512)
Features
http(default): HTTP client (dtmcli) viareqwestgrpc(default): gRPC client (dtmgrpc) viatonicworkflow(default): workflow engine aligned with Goworkflowbarrier-redis(default): Redis barrier utilities (Redis-only scope)
Disable defaults if you want a smaller dependency footprint:
Examples (dtmcli / dtmgrpc / workflow)
DTM quick start projects (recommended to run locally):
Environment variables used by examples:
DTM_HTTP_URL(defaulthttp://localhost:36789/api/dtmsvr)DTM_GRPC_ADDR(defaultlocalhost:36790)BUSI_HTTP_BASE(defaulthttp://localhost:8082/api/busi_start)BUSI_GRPC_ADDR(defaultlocalhost:50589)WORKFLOW_HTTP_CALLBACK(defaulthttp://localhost:8080/workflowResume)WORKFLOW_GRPC_LISTEN(default127.0.0.1:50051)WORKFLOW_GRPC_CLIENT_HOST(default127.0.0.1:50051)REDIS_URL(defaultredis://127.0.0.1/)GID(optional): if set, examples will reuse it instead of calling DTM/newGidorNewGid.
Run examples:
Notes:
- If you run DTM in Docker and your business services are on the host, set
IS_DOCKER=1solocalhostis rewritten tohost.docker.internal. - gRPC branch URLs use the format
host:port/fully.qualified.Service/Method(e.g.localhost:50589/busi.Busi/TransOut).
Parity tracking
See docs/parity.md.