Is there some way to save sender reference in a list when use remote akka?

160 views
Skip to first unread message

Liang Tang

unread,
Apr 11, 2014, 12:07:46 AM4/11/14
to akka...@googlegroups.com

Hi guys,

The problem confused me one day. I found that when the client actor has remotely connected with the server actor, the server actor can not remotely call the client again. Is that true? Based on my observation, only sender in server actor can send the message back to the client.

Imaging the server actor receives the messages from the clients. When some client is trying to initiate a connection to the server, is there some way to save every sender actor reference in some list for future use?

Let me know if there's something wrong in my declaration. 


Heiko Seeberger

unread,
Apr 11, 2014, 3:38:53 AM4/11/14
to Akka User List
Liang,

This is not true: Akka is location transparent. Therefore it doesn't matter where (locally, remotely) your actor lives, all will work the same way.

Heiko


--
>>>>>>>>>> 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.



--

Heiko Seeberger
Twitter: @hseeberger

√iktor Ҡlang

unread,
Apr 11, 2014, 4:09:43 AM4/11/14
to Akka User List
And, in Akka there are no clients and servers when it comes to Remoting. All are peers.
Cheers,

Liang Tang

unread,
Apr 11, 2014, 4:19:50 PM4/11/14
to akka...@googlegroups.com
The problem is still confusing me.

MachineB is able to periodically send messages to MachineA, and it works well. 

However, when Machine A initiated a connection with MachineB, there always exists something wrong. MachineA seems working very good when observing log.

Machine B received this message first:

[DEBUG] [04/11/2014 15:11:50.841] [TaskTracker1System-akka.remote.default-remote-dispatcher-5] [akka.tcp://TaskTrack...@127.0.0.1:10041/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FJobTrackerSystem%40127.0.0.1%3A10021-0/endpointWriter] received local message RemoteMessage: [ActorSelectionMessage(sdfs,Vector(user, TaskTrackerActor))] to [Actor[akka://TaskTracker1System/]]<+[akka://TaskTracker1System/] from [Actor[akka.tcp://JobTrack...@127.0.0.1:10021/user/JobTrackerActor#1759894673]()]
[DEBUG] [04/11/2014 15:11:50.840] [TaskTracker1System-akka.remote.default-remote-dispatcher-5] [akka.tcp://TaskTrack...@127.0.0.1:10041/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FJobTrackerSystem%40127.0.0.1%3A10021-0/endpointWriter] received local message RemoteMessage: [ActorSelectionMessage(sdfs,Vector(user, TaskTrackerActor))] to [Actor[akka://TaskTracker1System/]]<+[akka://TaskTracker1System/] from [Actor[akka.tcp://JobTrack...@127.0.0.1:10021/user/JobTrackerActor#1759894673]()]

Then, deadletters encountered in MachineB:
[INFO] [04/11/2014 15:11:50.840] [TaskTracker1System-akka.actor.default-dispatcher-3] [akka://TaskTracker1System/user/TaskTrackerActor] Message [java.lang.String] from Actor[akka.tcp://JobTrack...@127.0.0.1:10021/user/JobTrackerActor#1759894673] to Actor[akka://TaskTracker1System/user/TaskTrackerActor] was not delivered. [2] 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'.
[INFO] [04/11/2014 15:11:50.840] [TaskTracker1System-akka.actor.default-dispatcher-3] [akka://TaskTracker1System/user/TaskTrackerActor] Message [java.lang.String] from Actor[akka.tcp://JobTrack...@127.0.0.1:10021/user/JobTrackerActor#1759894673] to Actor[akka://TaskTracker1System/user/TaskTrackerActor] was not delivered. [2] 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'.

Does anyone tell me what makes the case happen.

Martynas Mickevičius

unread,
Apr 14, 2014, 10:56:21 AM4/14/14
to akka...@googlegroups.com
Hi Liang,

this is too little information for a definite answer. If you could package a small program which is able to reproduce your problem it would be great!


--
>>>>>>>>>> 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.



--
Martynas Mickevičius
TypesafeReactive Apps on the JVM

Liang Tang

unread,
Apr 15, 2014, 12:19:40 PM4/15/14
to akka...@googlegroups.com
I discovered the bug finally: the name in system.actorOf is wrongly defined. That Caused this bug.


On Monday, April 14, 2014 9:56:21 AM UTC-5, Martynas Mickevičius wrote:
Hi Liang,

this is too little information for a definite answer. If you could package a small program which is able to reproduce your problem it would be great!
On Fri, Apr 11, 2014 at 10:19 PM, Liang Tang <liang...@gmail.com> wrote:
The problem is still confusing me.

MachineB is able to periodically send messages to MachineA, and it works well. 

However, when Machine A initiated a connection with MachineB, there always exists something wrong. MachineA seems working very good when observing log.

Machine B received this message first:

[DEBUG] [04/11/2014 15:11:50.841] [TaskTracker1System-akka.remote.default-remote-dispatcher-5] [akka.tcp://TaskTracker1System@127.0.0.1:10041/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FJobTrackerSystem%40127.0.0.1%3A10021-0/endpointWriter] received local message RemoteMessage: [ActorSelectionMessage(sdfs,Vector(user, TaskTrackerActor))] to [Actor[akka://TaskTracker1System/]]<+[akka://TaskTracker1System/] from [Actor[akka.tcp://JobTrackerSyst...@127.0.0.1:10021/user/JobTrackerActor#1759894673]()]
[DEBUG] [04/11/2014 15:11:50.840] [TaskTracker1System-akka.remote.default-remote-dispatcher-5] [akka.tcp://TaskTracker1System@127.0.0.1:10041/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FJobTrackerSystem%40127.0.0.1%3A10021-0/endpointWriter] received local message RemoteMessage: [ActorSelectionMessage(sdfs,Vector(user, TaskTrackerActor))] to [Actor[akka://TaskTracker1System/]]<+[akka://TaskTracker1System/] from [Actor[akka.tcp://JobTrackerSyst...@127.0.0.1:10021/user/JobTrackerActor#1759894673]()]

Then, deadletters encountered in MachineB:
[INFO] [04/11/2014 15:11:50.840] [TaskTracker1System-akka.actor.default-dispatcher-3] [akka://TaskTracker1System/user/TaskTrackerActor] Message [java.lang.String] from Actor[akka.tcp://JobTrackerSyst...@127.0.0.1:10021/user/JobTrackerActor#1759894673] to Actor[akka://TaskTracker1System/user/TaskTrackerActor] was not delivered. [2] 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'.
[INFO] [04/11/2014 15:11:50.840] [TaskTracker1System-akka.actor.default-dispatcher-3] [akka://TaskTracker1System/user/TaskTrackerActor] Message [java.lang.String] from Actor[akka.tcp://JobTrackerSyst...@127.0.0.1:10021/user/JobTrackerActor#1759894673] to Actor[akka://TaskTracker1System/user/TaskTrackerActor] was not delivered. [2] 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'.

Does anyone tell me what makes the case happen.


On Thursday, April 10, 2014 11:07:46 PM UTC-5, Liang Tang wrote:

Hi guys,

The problem confused me one day. I found that when the client actor has remotely connected with the server actor, the server actor can not remotely call the client again. Is that true? Based on my observation, only sender in server actor can send the message back to the client.

Imaging the server actor receives the messages from the clients. When some client is trying to initiate a connection to the server, is there some way to save every sender actor reference in some list for future use?

Let me know if there's something wrong in my declaration. 


--
>>>>>>>>>> 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.
Reply all
Reply to author
Forward
0 new messages