Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ch8 Actors - CheckActors gives dead letter errors #33

Open
shafiquejamal opened this issue Aug 3, 2016 · 0 comments
Open

Ch8 Actors - CheckActors gives dead letter errors #33

shafiquejamal opened this issue Aug 3, 2016 · 0 comments

Comments

@shafiquejamal
Copy link

Hello, I'm having trouble with the CheckActors example in the book. When I try to run the following code:

class CheckActor extends Actor {

  import akka.actor.{Identify, ActorIdentity}
  val log = Logging(context.system, this)

  override def receive = {
    case path: String =>
      log.info(s"checking path $path")
      log.info(context.self.toString)
      log.info(context.parent.toString)
      context.actorSelection(path) ! Identify(path)
    case ActorIdentity(path, Some(ref)) =>
      log.info(s"found actor $ref at $path")
    case ActorIdentity(path, None) =>
      log.info(s"count not find an actor at path")

  }

}

// In main:
    val checker:ActorRef = ourSystem.actorOf(Props[CheckActor], "checker")
    checker ! "../*"

I get the following error (when running in the sbt console):

[INFO] [08/03/2016 14:55:29.998] [OurExampleSystem-akka.actor.default-dispatcher-2] [akka://OurExampleSystem/user/checker] checking path ../*
[INFO] [08/03/2016 14:55:29.999] [OurExampleSystem-akka.actor.default-dispatcher-2] [akka://OurExampleSystem/user/checker] Actor[akka://OurExampleSystem/user/checker#419406266]
[INFO] [08/03/2016 14:55:29.999] [OurExampleSystem-akka.actor.default-dispatcher-2] [akka://OurExampleSystem/user/checker] Actor[akka://OurExampleSystem/user]
[INFO] [08/03/2016 14:55:30.006] [OurExampleSystem-akka.actor.default-dispatcher-3] [akka://OurExampleSystem/user/checker] Message [akka.actor.ActorIdentity] from Actor[akka://OurExampleSystem/deadLetters] to Actor[akka://OurExampleSystem/user/checker#419406266] was not delivered. [1] dead letters encountered. This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.
[success] Total time: 0 s, completed Aug 3, 2016 2:55:30 PM

I tried it with the code from the code files too, and get the same result (without the extra logging statements). Can you suggest what I might be doing wrong? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant