The Wayback Machine - https://web.archive.org/web/20200624161312/https://github.com/eventflow/EventFlow/issues/608
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically add saga id to event metadata + create default SagaLocator #608

Open
mbican opened this issue Mar 16, 2019 · 1 comment
Open

Automatically add saga id to event metadata + create default SagaLocator #608

mbican opened this issue Mar 16, 2019 · 1 comment
Labels
Milestone

Comments

@mbican
Copy link
Contributor

@mbican mbican commented Mar 16, 2019

In documentation about sagas there is this thing about storing saga-id into event metadata. It looks intuitive but it doesn't work out of the box :-(. I would like to make it work. Here is how:

  1. from PublishAsync pass sagaId and saga type name into ICommandBus.PublishAsync()
  2. overload ICommandBus.PublishAsync() so it takes an extra argument eventMetadata
  3. pass event metadata to IAggregateStore.UpdateAsync()
  4. pass event metadata to AggregateRoot.CommitAsync()
  5. actually add eventMetadata into _uncommittedEvents
  6. then we could create a default implementation of SagaLocator which would find saga id and type name in event metadata

or the second option could be to put eventMetadata into command along with already included ISourceId

@ProH4Ck
Copy link
Contributor

@ProH4Ck ProH4Ck commented Aug 30, 2019

Hi,
I think this could be very uesful.
Following steps posted by @mbican I started to code an implementation here: https://github.com/ProH4Ck/EventFlow/tree/feature/saga-metadata
At the moment It's a full WIP and it works only for commands published by the saga.
What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
You can’t perform that action at this time.