- // TODO: follow https://github.com/akka/akka/issues/18758 to see if Akka adds a named
- // exception for quarantine detection
- if (message instanceof AssociationErrorEvent) {
- AssociationErrorEvent event = (AssociationErrorEvent) message;
- Throwable cause = event.getCause();
- if (cause instanceof InvalidAssociation) {
- Throwable cause2 = ((InvalidAssociation) cause).getCause();
- if (cause2.getMessage().contains("quarantined this system")) {
- quarantined = true;
-
- LOG.warn("Got quarantined by {}", event.getRemoteAddress());
+ if (message instanceof ThisActorSystemQuarantinedEvent) {
+ final ThisActorSystemQuarantinedEvent event = (ThisActorSystemQuarantinedEvent) message;
+ LOG.warn("Got quarantined by {}", event.remoteAddress());
+ quarantined = true;