"If there is a problem with recovering the state of the actor from the journal, the actor will be sent a RecoveryFailure message that it can choose to handle in receiveRecover. If the actor doesn’t handle the RecoveryFailure message it will be stopped"
public void onReceiveRecover(Object msg) {
// TODO Auto-generated method stub
log.info("MyPersistentTest onReceiveRecover" );
State st = this._currentState();
try {
if (msg instanceof myInfo) {
myInfo evt = (myInfo) msg;
} else if (msg instanceof SnapshotOffer) {
System.out.println("After get snapshot msg " );
} else if (msg instanceof RecoveryFailure) {
try {
RecoveryFailure evt = (RecoveryFailure) msg;
System.out.println(evt.cause());
recoveryCompleted();
//super.preStart();
} catch (InvalidClassException e) {
log.info("InvalidClassException: {}", e);
//e.printStackTrace();
}
//unhandled(msg);
}
else if (msg instanceof RecoveryCompleted) {
System.out.println("RecoveryCompleted" );
//recoveryCompleted();
//onRecoveryComplete();
//st = this._currentState();
}
else {
System.out.println("unhandled" );
//unhandled(msg);
}
} catch (Exception e) {
System.out.println("Exception" );
e.printStackTrace();
}
}
why my persist actor can not receive RecoveryCompleted msg.