0
votes

I have a play application where some actors are located in another ActorSystem. I'm trying to access the actors in that ActorSystem from the play application (basically I connect them to a REST API, i.e. send them messages when the play app gets a POST).

I'm creating this ActorSystem at start and I can confirm from the logs that it's indeed starting.

Let's assume the path of an actor in this separate system is akka://my-system/user/my-actor. How do I send a message to that actor?

I tried:

Akka.system.actorSelection("akka://my-system/user/my-actor") ! SomeMessage(...)

But this doesn't work. In the logs, I can see the following error (with deadLetters logging enabled):

Message ... from Actor[akka://application/deadLetters] to Actor[akka://application/deadLetters] was not delivered

Why doesn't it work?? And how can I get it to work?

Any help is much appreciated!

1

1 Answers

1
votes

If Akka.system is the "my-system" actor system, then you should be able to skip the "akka://my-system" part and go directly for "/user/my-actor".

If Akka.system is another actor system, then you can use remoting and specify a complete address to the other system, like this "akka.tcp://my-system@my-host:my-port/user/my-actor".