How to Passivate a EventSourcedBehavior entity

The only example in the documentation suggest to send a Passivate message to shard.

shard.tell(new ClusterSharding.Passivate<>(getContext().getSelf()));

But for EventSourcedBehavior Actors, they do not have reference to ActorRef which is needed param to create Passivate

Easiest is to use automatic passivation based on configuration.

The ActorContext can be used in EvenSourcrdBehavior in same way as other behaviors.

Thanks Patrik for the link, I am very new to Akka (2 weeks).

My primary goal is to have a fail safe always-on actor which can recover automatically. I used event sourced + Remember Entities for this, since this actor also has to a Timer which calls itself at certain schedule time. So when actor is reincarnated after crash, the timer event can set it up again.

My next goal is to properly delete/kill/remove/erase this Actor from the system after the timer is kicked off. Can you please guide what is the best recommended way of doing this.

After passivation it will not be started by remember entities again.