public abstract class ReadSideProcessor<Event extends AggregateEvent<Event>> extends Object
PersistentEntity
instances, and update some read side data store that is optimized for queries.
The events they consume must be tagged, and a read side is able to consume events of one or more tags. Events are
usually tagged according to some supertype of event, for example, events may be tagged as Order
events.
They may also be tagged according to a hash of the ID of the entity associated with the event - this allows read
side event handling to be sharded across many nodes. Tagging is done using
AggregateEventTag
.
Read side processors are responsible for tracking what events they have already seen. This is done using offsets,
which are sequential values associated with each event. Note that end users typically will not need to handle
offsets themselves, this will be provided by Lagom support specific to the read side datastore, and end users can
just focus on handling the events themselves.Modifier and Type | Class and Description |
---|---|
static class |
ReadSideProcessor.ReadSideHandler<Event extends AggregateEvent<Event>>
An read side offset processor.
|
Constructor and Description |
---|
ReadSideProcessor() |
Modifier and Type | Method and Description |
---|---|
abstract org.pcollections.PSequence<AggregateEventTag<Event>> |
aggregateTags()
The tags to aggregate.
|
abstract ReadSideProcessor.ReadSideHandler<Event> |
buildHandler()
Return a
ReadSideProcessor.ReadSideHandler for the given offset type. |
String |
readSideName()
The name of this read side.
|
public abstract ReadSideProcessor.ReadSideHandler<Event> buildHandler()
ReadSideProcessor.ReadSideHandler
for the given offset type.public abstract org.pcollections.PSequence<AggregateEventTag<Event>> aggregateTags()
public String readSideName()