8000 如何获得saga执行结果? · Issue #539 · dtm-labs/dtm · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

如何获得saga执行结果? #539

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
anotherGoogleFan opened this issue Dec 31, 2024 · 3 comments
Open

如何获得saga执行结果? #539

anotherGoogleFan opened this issue Dec 31, 2024 · 3 comments

Comments

@anotherGoogleFan
Copy link

代码所示:

	saga := dtmcli.NewSaga(dtmServer, dtmcli.MustGenGid(dtmServer)).
		Add(logic1Path, logic1RollbackPath, nil).
		Add(logic2Path, logic2RollbackPath, nil)
	saga.WaitResult = true
	if err := saga.Submit(); err != nil {
		slog.Info("fail", slog.Any("err", err))
		return
	}

这里 即使是指定了saga.Waitresult = true
也仍然无法知道 saga 执行是否成功,只能得知saga 是否成功地 Submit 了
我想在这里得知 saga的最终状态 (成功/回滚/重试), 应该如何操作

@yedf2
Copy link
Contributor
yedf2 commented Feb 4, 2025

你可以查询这个事务的状态,如果最后是succeed或failed,那么就知道最终状态

@liwooood
Copy link

哪为什么不吧saga的执行结果做成回调通知?

@liwooood
Copy link

没找到接口查询事务状态的?麻烦提示一下。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
0