mirror of https://github.com/dtm-labs/dtm.git
csharpjavadistributed-transactionsdtmgogolangmicroservicenodejsphpdatabasesagaseatatcctransactiontransactionsxapythondistributed
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
5 years ago | |
|---|---|---|
| .vscode | 5 years ago | |
| app | 5 years ago | |
| common | 5 years ago | |
| dtmsvr | 5 years ago | |
| examples | 5 years ago | |
| .gitignore | 5 years ago | |
| Dockerfile | 5 years ago | |
| README-en.md | 5 years ago | |
| README.md | 5 years ago | |
| compose.mysql.yml | 5 years ago | |
| conf.sample.yml | 5 years ago | |
| go.mod | 5 years ago | |
| go.sum | 5 years ago | |
| saga.go | 5 years ago | |
| tcc.go | 5 years ago | |
| xa.go | 5 years ago | |
README.md
轻量级分布式事务管理服务
- 跨语言
- 语言无关,基于http协议
- 多种分布式协议支持
- 支持xa、tcc、saga
运行示例
dtm依赖于mysql
使用已有的mysql:
cp conf.sample.yml conf.yml # 修改conf.yml
或者通过docker安装mysql
docker-compose up -f compose.mysql.yml
启动并运行saga示例
go run app/main.go
开始使用
安装
go get github.com/yedf/dtm
使用
gid := common.GenGid()
req := &gin.H{"amount": 30}
saga := dtm.SagaNew(DtmServer, gid).
Add(startBusi+"/TransOut", startBusi+"/TransOutCompensate", req).
Add(startBusi+"/TransIn", startBusi+"/TransInCompensate", req)
err := saga.Commit()
完整示例
参考examples/quick_start.go
交流群
请加 yedf2008 好友或者扫码加好友,验证回复 dtm 按照指引进群
