Skip to content

Read models are updated before event handlers that implement ISubscribeSynchronousToAll #877

Discussion options

You must be logged in to vote

Inspecting the source code I think 1. and 2. are backwards in your list

AggregateRoot.Emit() triggers application of the event to the aggregate state when it first emits. Then execution result is returned back where the AggregateStore.UpdateAsync() commits the events to the store then triggers DomainEventPublisher.PublishAsync(), which FIRST updates applicable read models and then dispatches to subscribers (Subscribers of ALL events first, then Sync subscribers, then Async Subscribers, then Sagas). If exceptions are thrown along that publishing path then execution stops. So if Read Models throw exceptions then subscribers aren't dispatched to. If SubcribersOfAllEvents results in an except…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by alasdair-stark-screenmedia
Comment options

You must be logged in to vote
1 reply
@alasdair-stark-screenmedia
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
3 participants
Converted from issue

This discussion was converted from issue #832 on June 17, 2021 05:46.