For logging purposes I would like to access lastSequenceNr (in the untyped akka-persistence this is a method of PersistentActor) from within a callback function registered as a side Effect in PersistentBehavior:
protected Effect<Event, State> persist(ActorContext<Command> ctx, Event event) {
return Effect().persist(event).andThen(s -> logEvent(ctx, event));
}
I don’t like the idea of keeping the analogous counter in the state object (if possible at all).