Event race conditions #3215
Unanswered
NQuirmbach
asked this question in
General
Replies: 1 comment
-
You might want to take this to Discord instead and get in from of more people. I'm converting this to a discussion, but Discord is more widely read |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey,
I'm not really sure where to post, since it's not really an issue, but more a lack of understanding 😆
I have a service, that receives two different event types from different sources. In my example it's users and todos. My goal is to create is a projection that contains all info from the todo and the assigned users.
Here a my models (simplified for testing purpose)
User Event
record UserCreated(Guid Id, string FirstName, string LastName)
Todo Event
record TodoCreated(Guid Id, string Description, Guid CreatedBy, Guid ChangedBy)
My projection should look something like this
record Todo(Guid Id, string Description, User CreatedBy, User ChangedBy)
Due to the nature of event driven, when processing the Todo event, it is not guaranteed that the User already exists.
Additionally in the future, I want to update the projection if a user changes.
I've played around the MultiStreamProjection and Custom Grouping, but not really get a sufficient solution.
Sample repo can be found here: https://github.com/NQuirmbach/marten-race-conditions/tree/setup-event-consumer
Hope you could help me here 😄
Beta Was this translation helpful? Give feedback.
All reactions