Akka 2.5 here. I have a need to determine if a particular ActorRef
is located on the same JVM as my application. My best attempt:
someActor.path().address().host().isEmpty()
...is returning true
for me (its empty; no address/host info available). Again, all I'm trying to do is determine if someActor
(which is an ActorRef
) is: (a) running inside the application JVM or (b) if it's a remote actor living inside another JVM and communicating w/ my app via akka-aremote.
Is there a better way to do this? Do I need to configure something inside application.conf
for this to work?
I don't think that is the proper way of doing it.
I suggest to send a message to target actor requesting current location and have the target actor respond back with hostname or address when you can compare and see.