A restart strategy is a supervision decision for an actor that fails while processing a message. The failed actor instance is removed and a new incarnation of the same behavior is created. Its ActorRef remains valid, so other actors keep sending through the same reference; the mailbox continues receiving messages for the replacement instance. section 5.1.2 section 5.3.3
Restart is a clean-state recovery choice: ordinary actor state is lost, unlike resume, which retains the existing instance and state. The message that caused the failure is normally not reprocessed, avoiding a poisoned mailbox where one corrupted input repeatedly prevents later work. section 5.1.2 section 5.3.1 section 5.3.3
Supervise an actor with restart
Wrap a behavior and choose restart for a selected failure type: Behaviors.supervise(behavior).onFailure[IndexOutOfBoundException](SupervisorStrategy.restart). On failure, processing is halted, the actor receives PreRestart, and setup code runs again when the new actor is spawned. section 5.3.3
Use restart deliberately around the failure boundary:
- Choose restart when discarding in-memory actor state and rebuilding the actor is safer than continuing after an exception. section 5.3.1 section 5.3.3
- Handle only relevant exception types when different failures need different outcomes; uncaught exception types terminate the actor under that strategy. section 5.3.1
- Use restartWithBackoff for failures from external services such as HTTP servers or databases, so retries wait and increase exponentially rather than reconnecting continuously. section 5.3.3
Follow the failure path from a message exception through PreRestart, actor removal, mailbox continuity, and replacement actor initialization. section 5.3.3

