Skip to content

Instantly share code, notes, and snippets.

@akgupta
Created September 18, 2016 18:54
Show Gist options
  • Save akgupta/6970efbbd68f32d7bb86c3a3992080df to your computer and use it in GitHub Desktop.
Save akgupta/6970efbbd68f32d7bb86c3a3992080df to your computer and use it in GitHub Desktop.
Send a message to the Actor managing an EventSource connection
// User B sends a message to User A
// We identify the Actor which manages the connection on which User A is connected (connectionIdA)
ActorSelection actorSelection = Akka.system().actorSelection("akka://application/user/" + connectionIdA);
// Send B's message to A's Actor
actorSelection.tell(new ClientMessage(data), ActorRef.noSender());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment