EventStore 和多个工作单元?
在对几个问题的回复中,Jonathan Oliver 提到使用 AsynchronousCommitDispatcher 来处理多个作品单位。
我仍处于项目的设计阶段(仍在学习 CRQS 和 ES),并且有几个问题:
我是否会为每个将受到引发的域事件影响的聚合根创建一个 AsynchronousCommitDispatcher?
如果我有某种锁定机制,如果聚合根被其他用户锁定,则调度的事件无法对聚合根进行更改,会发生什么情况?如果有锁,AsynchronousCommitDispatcher 会重试吗?
如果在处理域事件之前系统出现故障怎么办?除非我坚持没有处理过,否则它不会丢失吗?
我最初的理解是调度程序的类型用于通过网络发送消息或更新读取模型。这里我们用它来更新另一个聚合根。我这是正确的吗?
TIA
JD
In the reply to few questions, Jonathan Oliver mentions using an AsynchronousCommitDispatcher to handle multiple unit of works.
I am still in the design stage of my project (and still learning CRQS and ES) and have a few questions:
Would I create an AsynchronousCommitDispatcher for each aggregate root that will be affected by a domain event being raised?
What happens if I have some sort of locking mechanism where the dispatched event cannot make a change to an aggregate root if it is locked by another user? Does AsynchronousCommitDispatcher retry if there is a lock?
What if the system goes down before an domain event is handled? Unless I persist the fact that it has not been handled, wont it be lost?
My initial understanding was that the types of Dispatchers were for messaging across the wire or for updating the read model. Here we are using it to update another aggregate root. I this correct?
TIA
JD
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
提交调度程序的作用是在一切完全成功之后将事件推送到线路上。不,对于给定端点,您不需要多个调度程序。 AsyncCommitScheduler(使用调度程序)是多线程的,一次可以调度多个事件。
调度程序不是用来处理传入消息的——这就是消息处理程序的用途。一旦一切完成,调度员就会发送。
是的,调度程序可以帮助更新读取模型,但不是以您想象的方式。相反,调度程序只是将消息推送到消息传递框架(MSMQ、RabbitMQ,或者更高级别的 NServiceBus/MassTransit)中。然后,一旦您的视图模型收到消息,您就会相应地更新您的视图模型表。
The commit dispatchers are all about pushing events onto the wire after everything has been completely successfully. No, you don't need more than one dispatcher for a given endpoint. The AsyncCommitScheduler (which uses a dispatcher) is multi-threaded and can dispatch more than one event at a time.
A dispatcher is not about handling an incoming message--that's what your message handlers are for. The dispatcher just sends once everything is complete.
Yes dispatchers can help update read models, but not in the way you think. Instead, the dispatchers just push the messages into your messaging framework (MSMQ, RabbitMQ, or, at a higher level, NServiceBus/MassTransit). Then once a message is received at your view models, you update your view model tables accordingly.