[axonframework] Playback event for a specific date

Hi Krishna,

You could most definitely retrieve the events from an EventStore, although typically users create dedicated Query Models serving this purpose instead of querying the EventStore directly.

If you’d still prefer the latter, there are two functions you can leverage the retrieve all the events.

  1. EventStore#readEvents(String aggregateIdentifier)
  2. EventStore#openStream(TrackingToken trackingToken)

Option 1 will give you an EventStream for a specific Aggregate instance. This is what’s internally used to trigger the Event Sourcing process of an Aggregate, and is likely not what you’re looking for.
Option 2 will give you an EventStream starting from the given TrackingToken until the head of the stream.
This can likely provide you with the required functionality, as you can specify a TrackingToken to be on specific places on the EvenStream (a.k.a. different points in time).

Any how, I’d still suggest to introduce a dedicated Query Model for the ‘history of an action’, which is updated as events are published.

This is typically easier then querying the event store yourself and updating a view with all the events from that stream.

That’s my 2 cents.