Giter Club home page Giter Club logo

Comments (4)

JulianMay avatar JulianMay commented on May 26, 2024

CorrelationId? CausationId?

I think it's fine to keep it tight for "defaults", should be easy for consumers to add specific stuff like:

  • Acting userId
  • Feature flags
  • Origin vector (device/webUi/migration/integration)

from eventuous.

alexeyzimarev avatar alexeyzimarev commented on May 26, 2024

Correlation and causation id isn't easy as it would require commands to have an id. I am thinking about those too. Maybe the solution is to specify pre-defined header keys, and allow to pass a Metadata instance to the app service Handle.

Acting user id - yeah, we normally make it a part of the business (DoneBy property of each event), but maybe for impersonation scenarios, it would work differently.

Have you seen the Command API feature? The main issue with it is a missing context with all the important stuff, including the user identity. Again, it would work better if there would be a way to populate some of the properties from HttpContext, or have a convention to extract data from HttpContext and assign values to command properties.

Storing causation id would make little sense if commands aren't stored. You'd be having gaps in the sequence. It works fine with ESDB embedded projections and $correlationId as it gets populated for links and emitted events. But there, one event causes another event. On our side, it's a different flow, we have commands. Andrea Balducci talked about storing commands in Twitter, and I am thinking about the same for some time.

from eventuous.

JulianMay avatar JulianMay commented on May 26, 2024

For CausationId i was only thinking about if the transition was caused by an event, having the commands as events would bridge this I agree.

I've been down the path of storing commands in eventstore, and found it useful for diagnostics but the first thing you'd want to archive (or simply discard) - we ended up only doing it for certain types of aggregates, writing "CommandHandled" events to a stream per aggregate ($"CommandsHandled-{streamId}"), and having those with a max age of 3 months (scavenging the rest).

I had not seen the Command API feature! Looks very neat :)

At my previous gig we would have an overload for dispatching command, which would take a "context enrichment", which was monoidic. The 'command dispatcher' could be wrapped so one instance was aware of being used in a http context (enriching metadata with userId etc.), while another would be used by process managers, being aware of which policy was being used etc..
I liked how this gave us a seam to isolate 'the metadata we always want for changes comming this way', while keeping the door open for additional case-specific metadata.

from eventuous.

k3daevin avatar k3daevin commented on May 26, 2024

The actual date when the event was produced?
This would be very helpful for auditing. If Clients would like to know the State at a given Timestamp, this is not possible with the current API. You can display the events and load the aggregate or the state up to a particular event (providing a custom Store.Load-Function with count as parameter), but not to a Timestamp.
You could however achieve this by adding the Timestamp as a Domain property into each event. Although this feels like violating DDD principles.

(The created system meta of ESDB gets lost when migrating to another store)
I was wondering why the Timestamp is not included in StreamEvent.
Then the Timestamp might fit into Metadata.

A problem might be: what happens to old events when this new metadata is required? Set DateTime.Min or null?

If you have any plans on integrating the Creation Timestamp to the metadata, I'd love to contribute the Load-Functions for StateStore and AggregateStore with Timestamp as parameter.

from eventuous.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.