1
votes

I'm studying axon framework, I can't understand how I can recreate a past situation by limiting the events loaded by the EventStore. I'm using this configuration:

EventSourcingRepository repository = EventSourcingRepository.builder (ShipmentAggregate.class) .eventStore (eventStore) .build ();

how can I limit the loading of events to a given wax or to a progressive datum? thanks.

1

1 Answers

1
votes

You build an Eventhandler that tracks events from the given repository source and filter the events you need using optional MetaData parameters:

 @EventHandler
 public void on(AnEvent evt, @Timestamp Instant eventTimestamp) {
     // if eventTimestamp < lastThursday
     // do ....
 }