🔥A cross-language distributed transaction manager. Support xa, tcc, saga, transactional messages. 跨语言分布式事务管理器
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.
 
 
 
 
 
 
yedongfu 212d7dae4b update readme 5 years ago
.vscode init 5 years ago
app readme cn ok 5 years ago
common compose mysql changed 5 years ago
dtmsvr compose mysql changed 5 years ago
examples readme cn ok 5 years ago
.gitignore compose mysql changed 5 years ago
Dockerfile docker run ok 5 years ago
README-en.md readme cn ok 5 years ago
README.md update readme 5 years ago
compose.mysql.yml compose mysql changed 5 years ago
conf.sample.yml readme cn ok 5 years ago
go.mod conf changed 5 years ago
go.sum conf changed 5 years ago
saga.go add query 5 years ago
tcc.go add query 5 years ago
xa.go compose mysql changed 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 按照指引进群

yedf2008