Skip to content

Read models are updated before event handlers that implement ISubscribeSynchronousToAll #832

@alasdair-stark-screenmedia

Description

We publish all events to event grid using a custom class that implements ISubscribeSynchronousToAll.

I have noticed during testing that the event is not published to event grid until the read models that subscribe to that event have been updated.

Could someone confirm that this is the expected behaviour? When an aggregate emits an event, is the event handled in a synchronous manner in a pre-defined order? For example, is it something like this:

  1. Write event to EventFlow table
  2. Apply event to aggregate
  3. Update read models
  4. Publish to event grid

I'm a bit confused because I had assumed that the subscribers (read model and event grid) would run in parallel.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions