下載最新版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服務器,日志如下

