轴突首先保存事件中的事件或首先在事件总线中发布事件?
我正在尝试为轴突工作流程制作一个序列图。但是,我不确定事件处理顺序是什么。 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
可能想知道的是,从Axon的角度来看,
EventStore
是eventbus
的更具体的实现。您可以在查看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 anEventBus
. You can see this when looking at theAbstractEventStore
implementation, which extends theAbstractEventBus
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 theprepareCommit
method to prepare the transaction/UnitOfWork for committing. It is here that Axon invokesSubscribingEventProcessors
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 theEventBus
comes second.