AggregateLifecycle
provides a simple means to achieve the above:AggregateLifecycle#apply(Object)
will go through a number of steps:Object
, will be wrapped in an EventMessage
.EventMessage
will also receive the sequenceNumber
from the previous step, as well as the Aggregate it's identifier.EventBus
.MetaData in Aggregate Event MessagesTheAggregateLifecycle
also provides anapply(Object, MetaData)
function. This can be used to attach command-handler specific MetaData.