compare self.path.address with a remote actor address

55 views
Skip to first unread message

Kostas kougios

unread,
Sep 29, 2015, 8:34:53 AM9/29/15
to Akka User List
I have an akka cluster and keep a member registry. member.address is an instance of UniqueAddress with the host name and port.

self.path.address is an Address without those. So comparing doesn't work.

What I want to do is filter out self out of the selected actors:

val myAddress=self.path.address
members.filterNot(_.address == myAddress).map(m => actorSelection(....path via m.address...))

But it doesn't filter it.


Kostas kougios

unread,
Sep 29, 2015, 9:02:03 AM9/29/15
to Akka User List
found a solution here:
http://stackoverflow.com/questions/14288068/how-do-i-get-the-absolute-remote-actor-url-from-inside-the-actor
via the RemoteAddressExtension. Not sure if it is the most optimal

Patrik Nordwall

unread,
Sep 29, 2015, 11:43:51 AM9/29/15
to akka...@googlegroups.com
If you use Akka Cluster you have access to the address with Cluster(system).selfAddress

/Patrik

--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.



--

Patrik Nordwall
Typesafe Reactive apps on the JVM
Twitter: @patriknw

Konstantinos Kougios

unread,
Sep 29, 2015, 12:08:53 PM9/29/15
to akka...@googlegroups.com
ah, ok thanks
You received this message because you are subscribed to a topic in the Google Groups "Akka User List" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/akka-user/tBteea4943M/unsubscribe.
To unsubscribe from this group and all its topics, send an email to akka-user+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages