轴突首先保存事件中的事件或首先在事件总线中发布事件?

发布于 2025-02-08 18:54:53 字数 80 浏览 1 评论 0原文

我正在尝试为轴突工作流程制作一个序列图。但是,我不确定事件处理顺序是什么。 Axon是否首先将事件保存在事件商店中,还是首先在事件总线上发布事件?

I am trying to make a sequence diagram for Axon workflow. However, I am not sure what's the event processing order. Does Axon save events in the Event Store first, or does it publish the events on the Event Bus first?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

誰認得朕 2025-02-15 18:54:54

可能想知道的是,从Axon的角度来看,EventStoreeventbus的更具体的实现。您可以在查看 AbstractEventStore实现,它扩展了 AbstractEventBus实现

发布的操作将将事件分组为单个交易。或者,用轴突术语,unitofwork。在对此进行任何操作之前,它将调用PrepareCommit方法来准备交易/单位工程进行提交。正是在这里,Axon调用sisscribingEventProcessors并存储事件。

但是,存储事件首先发生,然后向订阅处理器以后出现。从这个角度来看,您可以指出存储在EventStore中是第一个,并且在eventbus上发布在第二位。

What might be curious to know is that from Axon's perspective, the EventStore is a more specific implementation of an EventBus. You can see this when looking at the AbstractEventStore implementation, which extends the AbstractEventBus implementation.

The operation to publish will group the events into a single transaction. Or, in Axon terms, the UnitOfWork. Before doing anything with it, it'll invoke the prepareCommit method to prepare the transaction/UnitOfWork for committing. It is here that Axon invokes SubscribingEventProcessors and stores events.

However, storing events happens first, and providing events to the Subscribing Processors comes later. From that perspective, you can state that storing in the EventStore comes first, and publishing on the EventBus comes second.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文