Replies: 1 comment
-
|
I believe you can easily write a custom version of But I wonder if that's the right way to go. The consequence is that you'll have your PM collect events basing on their metadata, which is technical data. For some people it's probably fine, but for some other it might be a no-no :) I'd rather avoid that unless I really need to. And in your particular example the only thing you gain is that you can avoid a conditional that would take the relevant id from the right attribute. In my experience this is something that you normally do because the ids often come under different names. I never tried to avoid that. But in general, I think it could be useful to use the commands |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Assuming the usage of
RubyEventStore::CorrelatedCommands, if the flow starts with a command, thecorrelation_idpassed forward to events is always the command'smessage_id(as seen here).It seems that passing explicit
correlation_idto the command doesn't change this behavior.I wondered - what if I wanted to have a specific
correlation_idthat I want to pass to the command?Let's say I have a command that starts a room check-in process handled by a Process Manager, which subscribes to domain events from multiple bounded contexts:
Reservingwithbooking_idin its domain eventsHousekeepingwithstay_idin its domain eventsHow in this scenario, in which
booking_id&stay_idshould be the same thing as far as PM is concerned, could the stream name for the PM be build without an explicit builder per event/bounded context?I can use
correlation_idfor that, but then the stream name includes the command'smessage_id, and because commands are not persisted, I'm not sure it'd be easy to find and debug if needed. Instead, maybe I could use the core domain aggregate root id as acorrelation_idin the command, and then use it to build the stream name?I'm not sure if this question is valid, it may be that there's just a design problem here 😉
While trying to find opinions on this approach, I came across this EventStore discussion, particularly this comment.
Beta Was this translation helpful? Give feedback.
All reactions