library icon indicating copy to clipboard operation
library copied to clipboard

Create concept of PublishedEvent

Open pilloPl opened this issue 6 years ago • 2 comments

So currently the all of the domain events have information about business facts.

If we want to publish them we need to add metadata like:

causationID, corellationID, uniqueMessageID etc

so PublishedEvent becomes DomainEvent + metadata

pilloPl avatar Mar 28 '19 09:03 pilloPl

So, if I understand correctly, do you mean that

public interface EventsStorage {

    void save(DomainEvent event);

    List<DomainEvent> toPublish();

    void published(List<DomainEvent> events);
}

should be more like

public interface EventsStorage {

    void save(DomainEvent event);

    List<DomainEvent> toPublish();

    void published(List<PublishedEvent> events);
}

ghost avatar Apr 17 '19 15:04 ghost

I mean that PublishedEvent should keep DomainEvent inside :)

pilloPl avatar May 08 '19 14:05 pilloPl