下载最新版seata
https://github.com/seata/seata/releases
下载示例代码
https://github.com/rudolflin/seata-samples
-
解压seata. 修改file.conf文件, 使用samples中的这个文件中的内容, 全部覆盖
-
运行示例项目,
- 运行sql
- 运行sql
-
启动项目, 接口在business工程中
提交 http://localhost:8084/api/business/purchase/commit
模拟异常回滚(account服务触发runtimeexception) http://localhost:8084/api/business/purchase/rollback -
启动项目后, 可见项目会注册到seata服务器,日志如下