lastSequenceNr accessible from PersistentBehavior

akka-typed

(Paweł Kaczor) #1

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).


(Konrad `ktoso` Malawski) #2

I can’t remember but we could put it into the context right? Maybe open a ticket?


(Paweł Kaczor) #3

Issue created: https://github.com/akka/akka/issues/25113