Search code examples
scalacqrsevent-sourcinglagom

What is an Event Tag in lagom framework?


From the doc : https://www.lagomframework.com/documentation/1.5.x/scala/ReadSide.html

It says :

Event tags
In order to consume events from a read-side, the events need to be tagged. All events with a particular tag can be consumed as a sequential, ordered stream of events. Events can be tagged by making them implement the AggregateEvent interface. The tag is defined using the aggregateTag method.

Q1 . What does it mean when it says consumed as sequential,ordered stream of events?
Q2. Why Tagging of events when there is offset?


Solution

  • A1. The read-side(s) will see the events for an entity in the order in which they were persisted by the write-side.

    A2. Tagging is used so that different read-sides can subscribe to only specific events.