You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So the events are consumed to the projections from the command handler ?
What if the machine stops ?
What if the view database have issues ?
What will happen when the service restarts ?
The text was updated successfully, but these errors were encountered:
jrouaix
changed the title
How about updating query FROM the event store and not from the command handler ?
How about updating queries FROM the event store and not from the command handler ?
May 12, 2022
You are correct that once any events are emitted from the command handler they become historical facts and are committed regardless of any query failures. This is essentially where the command phase of CQRS ends and the query phase begins. To keep the two phases decoupled, queries must manage failure conditions on their own.
For simple failure modes such as a view error you should deal with the error directly within the Query that you are using. If you are using a GenericQuery from the persist module this would entail noting the error (logs, telemetry, etc.) via an error handler in order to correct the issue.
To rectify more complex failures, a common solution is to use a field in a query to record the latest event that has been processed. Then, after a failure any query that is missing events can be identified and corrected.
A good mental model is that of these phases as two different services communicating via an event bus, and the same sort of failure recovery strategies apply.
Hello guys
We were PoCing around your crate when found this :
cqrs/src/cqrs.rs
Line 154 in 09fc47b
So the events are consumed to the projections from the command handler ?
What if the machine stops ?
What if the view database have issues ?
What will happen when the service restarts ?
The text was updated successfully, but these errors were encountered: