Re: [akka-user] Remote communication with ActorSytems started on single JVM

195 views
Skip to first unread message

√iktor Ҡlang

unread,
Jun 1, 2012, 8:15:51 AM6/1/12
to akka...@googlegroups.com


On Fri, Jun 1, 2012 at 2:10 PM, Yaroslav Klymko <t3h...@gmail.com> wrote:
Hi,

There is something inconvenient for me.
I'm using akka 2.0.1
 
object TestServer extends App {
  val first = ActorSystem("first")
  val last = ActorSystem("last")
  last.actorOf(Props(new LogActor), "test")
  first.actorOf(Props(new LogActor), "test")
}
class LogActor extends Actor {
  protected def receive = {
    case x => println(x)
  }
}
object TestClient extends App {
  ActorSystem().actorFor("akka://la...@127.0.0.1:2552/user/test") ! "last"
  ActorSystem().actorFor("akka://fi...@127.0.0.1:2552/user/test") ! "first"
}

I have two systems (first and last) started on on JVM and trying to send messages to both of them from different JVM
However I can not send message to ActorSystem which was not initialized first.

I have the same bug on my phone! If I start talking before the callee picks up the phone they won't hear it :(
 

15:00:33.475 INFO  [first-akka.actor.default-dispatcher-1] akka.event.slf4j.Slf4jEventHandler - Slf4jEventHandler started
15:00:33.974 INFO  [first-akka.actor.default-dispatcher-1] akka.actor.ActorSystemImpl - REMOTE: RemoteServerStarted@akka://fi...@127.0.0.1:2552
15:00:34.199 INFO  [last-akka.actor.default-dispatcher-2] akka.event.slf4j.Slf4jEventHandler - Slf4jEventHandler started
15:00:34.222 INFO  [last-akka.actor.default-dispatcher-2] akka.actor.ActorSystemImpl - REMOTE: RemoteServerStarted@akka://la...@127.0.0.1:2552
15:00:47.508 INFO  [first-akka.actor.default-dispatcher-3] akka.actor.ActorSystemImpl - REMOTE: RemoteClientStarted@akka://def...@127.0.0.1:2553
15:00:47.550 ERROR [first-akka.actor.default-dispatcher-5] NettyRemoteTransport(null) - dropping message last for non-local recipient akka://la...@127.0.0.1:2552/user/test at akka://fi...@127.0.0.1:2552 local is akka://fi...@127.0.0.1:2552
15:00:47.570 INFO  [first-akka.actor.default-dispatcher-5] akka.actor.ActorSystemImpl - REMOTE: RemoteClientStarted@akka://def...@127.0.0.1:2553
15:00:47.576 INFO  [first-akka.actor.default-dispatcher-5] akka.actor.ActorSystemImpl - REMOTE: RemoteClientShutdown@akka://def...@127.0.0.1:2553
first


--
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To view this discussion on the web visit https://groups.google.com/d/msg/akka-user/-/s38Sl9uX-UEJ.
To post to this group, send email to akka...@googlegroups.com.
To unsubscribe from this group, send email to akka-user+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/akka-user?hl=en.



--
Viktor Klang

Akka Tech Lead
Typesafe - The software stack for applications that scale

Twitter: @viktorklang

Jonas Bonér

unread,
Jun 1, 2012, 8:24:40 AM6/1/12
to akka...@googlegroups.com
On Fri, Jun 1, 2012 at 2:15 PM, √iktor Ҡlang <viktor...@gmail.com> wrote:
>
>
> On Fri, Jun 1, 2012 at 2:10 PM, Yaroslav Klymko <t3h...@gmail.com> wrote:
>>
>> Hi,
>>
>> There is something inconvenient for me.
>> I'm using akka 2.0.1
>>
>>>
>>> object TestServer extends App {
>>>   val first = ActorSystem("first")
>>>   val last = ActorSystem("last")
>>>   last.actorOf(Props(new LogActor), "test")
>>>   first.actorOf(Props(new LogActor), "test")
>>> }
>>> class LogActor extends Actor {
>>>   protected def receive = {
>>>     case x => println(x)
>>>   }
>>> }
>>> object TestClient extends App {
>>>   ActorSystem().actorFor("akka://la...@127.0.0.1:2552/user/test") ! "last"
>>>   ActorSystem().actorFor("akka://fi...@127.0.0.1:2552/user/test") !
>>> "first"
>>> }
>>
>>
>> I have two systems (first and last) started on on JVM and trying to send
>> messages to both of them from different JVM
>> However I can not send message to ActorSystem which was not initialized
>> first.
>
>
> I have the same bug on my phone! If I start talking before the callee picks
> up the phone they won't hear it :(

My wife has the same problem. If she starts speaking to me while I'm
hacking, before I get a chance to fully switch context, then I won't
hear anything she is saying. Drives her nuts, but can be quite
convenient sometimes.
Jonas Bonér
CTO
Typesafe - The software stack for applications that scale
Phone: +46 733 777 123
Twitter: @jboner

√iktor Ҡlang

unread,
Jun 1, 2012, 8:27:48 AM6/1/12
to akka...@googlegroups.com
Haha, I get tons of crap from Sandra for that. Glad to hear it's not just me!

√iktor Ҡlang

unread,
Jun 1, 2012, 8:33:53 AM6/1/12
to akka...@googlegroups.com
You can't use the same host and port for more than one ActorSystem

Cheers,


On Fri, Jun 1, 2012 at 2:31 PM, Yaroslav Klymko <t3h...@gmail.com> wrote:
Haha very funny :)

However, 
I meant that the message will go only to second system and will be dropped from the first one...
So whenever I have more then one ActorSystem on the single JVM I can't reach remotely one of them....
Could you please read logs I'v attached ?

Best regards.
>>> RemoteServerStarted@akka://firs...@127.0.0.1:2552
>>> 15:00:34.199 INFO  [last-akka.actor.default-dispatcher-2]
>>> akka.event.slf4j.Slf4jEventHandler - Slf4jEventHandler started
>>> 15:00:34.222 INFO  [last-akka.actor.default-dispatcher-2]
>>> akka.actor.ActorSystemImpl - REMOTE:
>>> RemoteServerStarted@akka://last...@127.0.0.1:2552
>>> 15:00:47.508 INFO  [first-akka.actor.default-dispatcher-3]
>>> akka.actor.ActorSystemImpl - REMOTE:
>>> RemoteClientStarted@akka://defau...@127.0.0.1:2553
>>> 15:00:47.550 ERROR [first-akka.actor.default-dispatcher-5]
>>> NettyRemoteTransport(null) - dropping message last for non-local recipient
>>> akka://la...@127.0.0.1:2552/user/test at akka://fi...@127.0.0.1:2552 local is
>>> akka://fi...@127.0.0.1:2552
>>> 15:00:47.570 INFO  [first-akka.actor.default-dispatcher-5]
>>> akka.actor.ActorSystemImpl - REMOTE:
>>> RemoteClientStarted@akka://defau...@127.0.0.1:2553
>>> 15:00:47.576 INFO  [first-akka.actor.default-dispatcher-5]
>>> akka.actor.ActorSystemImpl - REMOTE:
>>> RemoteClientShutdown@akka://defa...@127.0.0.1:2553
>>> first
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Akka User List" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/akka-user/-/s38Sl9uX-UEJ.
>> To post to this group, send email to akka...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> For more options, visit this group at
>> http://groups.google.com/group/akka-user?hl=en.
>
>
>
>
> --
> Viktor Klang
>
> Akka Tech Lead
> Typesafe - The software stack for applications that scale
>
> Twitter: @viktorklang
>
> --
> You received this message because you are subscribed to the Google Groups
> "Akka User List" group.
> To post to this group, send email to akka...@googlegroups.com.
> To unsubscribe from this group, send email to
> For more options, visit this group at
> http://groups.google.com/group/akka-user?hl=en.



--
Jonas Bonér
CTO
Typesafe - The software stack for applications that scale
Phone: +46 733 777 123
Twitter: @jboner

--
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To view this discussion on the web visit https://groups.google.com/d/msg/akka-user/-/GAKn5Jg7OM4J.

To post to this group, send email to akka...@googlegroups.com.
To unsubscribe from this group, send email to akka-user+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/akka-user?hl=en.

Derek Wyatt

unread,
Jun 1, 2012, 8:37:32 AM6/1/12
to akka...@googlegroups.com
On 2012-06-01, at 8:33 AM, √iktor Ҡlang wrote:

You can't use the same host and port for more than one ActorSystem

If that's the case then I think there's a potential ticket here, no?

>>> RemoteServerStarted@akka://firs...@127.0.0.1:2552 
>>> 15:00:34.199 INFO  [last-akka.actor.default-dispatcher-2] 
>>> akka.event.slf4j.Slf4jEventHandler - Slf4jEventHandler started 
>>> 15:00:34.222 INFO  [last-akka.actor.default-dispatcher-2] 
>>> akka.actor.ActorSystemImpl - REMOTE: 
>>> RemoteServerStarted@akka://last...@127.0.0.1:2552 
>>> 15:00:47.508 INFO  [first-akka.actor.default-dispatcher-3] 

How is it possible that "RemoteServerStarted @ akka://la...@127.0.0.1:2552" appears?  Why wouldn't it be "RemoteServerNOTStarted due to 'port already in use' error"?
signature.asc

√iktor Ҡlang

unread,
Jun 1, 2012, 8:45:34 AM6/1/12
to akka...@googlegroups.com
On Fri, Jun 1, 2012 at 2:37 PM, Derek Wyatt <de...@derekwyatt.org> wrote:

On 2012-06-01, at 8:33 AM, √iktor Ҡlang wrote:

You can't use the same host and port for more than one ActorSystem

If that's the case then I think there's a potential ticket here, no?

There is already a ticket, but IMHO it doesn't make sense. What would it mean? When would you shut the port down? It's global state, so how do you test it?
 

>>> RemoteServerStarted@akka://firs...@127.0.0.1:2552 
>>> 15:00:34.199 INFO  [last-akka.actor.default-dispatcher-2] 
>>> akka.event.slf4j.Slf4jEventHandler - Slf4jEventHandler started 
>>> 15:00:34.222 INFO  [last-akka.actor.default-dispatcher-2] 
>>> akka.actor.ActorSystemImpl - REMOTE: 
>>> RemoteServerStarted@akka://last...@127.0.0.1:2552 
>>> 15:00:47.508 INFO  [first-akka.actor.default-dispatcher-3] 

How is it possible that "RemoteServerStarted @ akka://la...@127.0.0.1:2552" appears?  Why wouldn't it be "RemoteServerNOTStarted due to 'port already in use' error"?

Also, I do not know if he's running in daemonic mode or not, so I don't know if his TestServer is exiting after init or not.

Cheers,

Derek Wyatt

unread,
Jun 1, 2012, 8:48:50 AM6/1/12
to akka...@googlegroups.com

There is a ton of historical precedent here.  The "port already in use" error is a well known error condition as I'm sure you know.  I get what you're saying but might you be getting buried in the corner cases?
signature.asc

√iktor Ҡlang

unread,
Jun 1, 2012, 8:58:05 AM6/1/12
to akka...@googlegroups.com
On Fri, Jun 1, 2012 at 2:48 PM, Derek Wyatt <de...@derekwyatt.org> wrote:

There is a ton of historical precedent here.  The "port already in use" error is a well known error condition as I'm sure you know.  I get what you're saying but might you be getting buried in the corner cases?


Well.... this is what I get:

scala> val as = akka.actor.ActorSystem("foo", parseString("""
     | akka {
     |   actor.provider = "akka.remote.RemoteActorRefProvider"
     |   remote.netty {
     |     hostname = localhost
     |     port = 12345
     |   }
     | }"""))
[INFO] [06/01/2012 14:56:55.818] [run-main] [ActorSystem(foo)] RemoteServerStarted@akka://foo@localhost:12345
as: akka.actor.ActorSystem = akka://foo

scala> val as = akka.actor.ActorSystem("bar", parseString("""
     |       akka {
     |         actor.provider = "akka.remote.RemoteActorRefProvider"
     |         remote.netty {
     |           hostname = localhost
     |           port = 12345
     |         }
     |       }"""))
org.jboss.netty.channel.ChannelException: Failed to bind to: localhost/127.0.0.1:12345
at org.jboss.netty.bootstrap.ServerBootstrap.bind(ServerBootstrap.java:298)
at akka.remote.netty.NettyRemoteServer.start(Server.scala:55)
at akka.remote.netty.NettyRemoteTransport.start(NettyRemoteSupport.scala:161)
at akka.remote.RemoteActorRefProvider.init(RemoteActorRefProvider.scala:83)
at akka.actor.ActorSystemImpl._start(ActorSystem.scala:576)
at akka.actor.ActorSystemImpl.start(ActorSystem.scala:583)
at akka.actor.ActorSystem$.apply(ActorSystem.scala:99)
at akka.actor.ActorSystem$.apply(ActorSystem.scala:94)
at .<init>(<console>:8)
at .<clinit>(<console>)
at .<init>(<console>:11)
at .<clinit>(<console>)
at $print(<console>)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at scala.tools.nsc.interpreter.IMain$ReadEvalPrint.call(IMain.scala:704)
at scala.tools.nsc.interpreter.IMain$Request.loadAndRun(IMain.scala:914)
at scala.tools.nsc.interpreter.IMain.loadAndRunReq$1(IMain.scala:546)
at scala.tools.nsc.interpreter.IMain.interpret(IMain.scala:577)
at scala.tools.nsc.interpreter.IMain.interpret(IMain.scala:543)
at scala.tools.nsc.interpreter.ILoop.reallyInterpret$1(ILoop.scala:694)
at scala.tools.nsc.interpreter.ILoop.interpretStartingWith(ILoop.scala:745)
at scala.tools.nsc.interpreter.ILoop.reallyInterpret$1(ILoop.scala:712)
at scala.tools.nsc.interpreter.ILoop.interpretStartingWith(ILoop.scala:745)
at scala.tools.nsc.interpreter.ILoop.reallyInterpret$1(ILoop.scala:712)
at scala.tools.nsc.interpreter.ILoop.interpretStartingWith(ILoop.scala:745)
at scala.tools.nsc.interpreter.ILoop.reallyInterpret$1(ILoop.scala:712)
at scala.tools.nsc.interpreter.ILoop.interpretStartingWith(ILoop.scala:745)
at scala.tools.nsc.interpreter.ILoop.reallyInterpret$1(ILoop.scala:712)
at scala.tools.nsc.interpreter.ILoop.interpretStartingWith(ILoop.scala:745)
at scala.tools.nsc.interpreter.ILoop.reallyInterpret$1(ILoop.scala:712)
at scala.tools.nsc.interpreter.ILoop.interpretStartingWith(ILoop.scala:745)
at scala.tools.nsc.interpreter.ILoop.reallyInterpret$1(ILoop.scala:712)
at scala.tools.nsc.interpreter.ILoop.interpretStartingWith(ILoop.scala:745)
at scala.tools.nsc.interpreter.ILoop.reallyInterpret$1(ILoop.scala:712)
at scala.tools.nsc.interpreter.ILoop.interpretStartingWith(ILoop.scala:745)
at scala.tools.nsc.interpreter.ILoop.command(ILoop.scala:651)
at scala.tools.nsc.interpreter.ILoop.processLine$1(ILoop.scala:542)
at scala.tools.nsc.interpreter.ILoop.loop(ILoop.scala:550)
at scala.tools.nsc.interpreter.ILoop.process(ILoop.scala:822)
at scala.tools.nsc.interpreter.ILoop.main(ILoop.scala:851)
at xsbt.ConsoleInterface.run(ConsoleInterface.scala:57)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sbt.compiler.AnalyzingCompiler.call(AnalyzingCompiler.scala:57)
at sbt.compiler.AnalyzingCompiler.console(AnalyzingCompiler.scala:48)
at sbt.Console.console0$1(Console.scala:23)
at sbt.Console$$anonfun$apply$2$$anonfun$apply$1.apply$mcV$sp(Console.scala:24)
at sbt.TrapExit$.executeMain$1(TrapExit.scala:33)
at sbt.TrapExit$$anon$1.run(TrapExit.scala:42)
Caused by: java.net.BindException: Address already in use
at sun.nio.ch.Net.bind(Native Method)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:126)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59)
at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.bind(NioServerSocketPipelineSink.java:140)
at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.handleServerSocket(NioServerSocketPipelineSink.java:92)
at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.eventSunk(NioServerSocketPipelineSink.java:66)
at org.jboss.netty.channel.Channels.bind(Channels.java:462)
at org.jboss.netty.channel.AbstractChannel.bind(AbstractChannel.java:186)
at org.jboss.netty.bootstrap.ServerBootstrap$Binder.channelOpen(ServerBootstrap.java:343)
at org.jboss.netty.channel.Channels.fireChannelOpen(Channels.java:170)
at org.jboss.netty.channel.socket.nio.NioServerSocketChannel.<init>(NioServerSocketChannel.java:77)
at org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory.newChannel(NioServerSocketChannelFactory.java:137)
at org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory.newChannel(NioServerSocketChannelFactory.java:85)
at org.jboss.netty.bootstrap.ServerBootstrap.bind(ServerBootstrap.java:277)
... 53 more

Derek Wyatt

unread,
Jun 1, 2012, 8:59:33 AM6/1/12
to akka...@googlegroups.com
Well, that sure as hell looks right to me :)
signature.asc

√iktor Ҡlang

unread,
Jun 1, 2012, 9:24:45 AM6/1/12
to akka...@googlegroups.com


On Fri, Jun 1, 2012 at 3:21 PM, Yaroslav Klymko <t3h...@gmail.com> wrote:
However I'm not getting this one...
I think that's because both of my ActorSystem use the same application.conf.
Is it the case?

I do not know. Enable logging and verify.

Cheers,
 
To view this discussion on the web visit https://groups.google.com/d/msg/akka-user/-/pQ2e3F_lbgIJ.

To post to this group, send email to akka...@googlegroups.com.
To unsubscribe from this group, send email to akka-user+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/akka-user?hl=en.

√iktor Ҡlang

unread,
Jun 1, 2012, 9:47:51 AM6/1/12
to akka...@googlegroups.com
Sorry man, cannot reproduce:

scala> val as = akka.actor.ActorSystem("bar", parseString("""
     |       akka {
     |         actor.provider = "akka.remote.RemoteActorRefProvider"
     |         remote.netty {
     |           hostname = "127.0.0.1"
     |           port = 2552
     |         }
     |       }"""))
[INFO] [06/01/2012 15:47:00.203] [run-main] [ActorSystem(bar)] RemoteServerStarted@akka://b...@127.0.0.1:2552
as: akka.actor.ActorSystem = akka://bar

scala> val as = akka.actor.ActorSystem("foo", parseString("""
     |       akka {
     |         actor.provider = "akka.remote.RemoteActorRefProvider"
     |         remote.netty {
     |           hostname = "127.0.0.1"
     |           port = 2552
     |         }
     |       }"""))
org.jboss.netty.channel.ChannelException: Failed to bind to: /127.0.0.1:2552
at org.jboss.netty.bootstrap.ServerBootstrap.bind(ServerBootstrap.java:298)
at akka.remote.netty.NettyRemoteServer.start(Server.scala:55)
at akka.remote.netty.NettyRemoteTransport.start(NettyRemoteSupport.scala:161)
at akka.remote.RemoteActorRefProvider.init(RemoteActorRefProvider.scala:83)
at akka.actor.ActorSystemImpl._start(ActorSystem.scala:576)
at akka.actor.ActorSystemImpl.start(ActorSystem.scala:583)
at akka.actor.ActorSystem$.apply(ActorSystem.scala:99)
at akka.actor.ActorSystem$.apply(ActorSystem.scala:94)
at .<init>(<console>:16)
Cheers,

On Fri, Jun 1, 2012 at 3:31 PM, Yaroslav Klymko <t3h...@gmail.com> wrote:
16:30:13.249 INFO  [first-akka.actor.default-dispatcher-1] akka.event.slf4j.Slf4jEventHandler - Slf4jEventHandler started
16:30:13.294 DEBUG [first-akka.actor.default-dispatcher-2] akka.event.EventStream - logger log1-Slf4jEventHandler started
16:30:13.294 DEBUG [first-akka.actor.default-dispatcher-2] akka.event.EventStream - Default Loggers started
16:30:13.299 DEBUG [first-akka.actor.default-dispatcher-2] akka.event.EventStream - unsubscribing StandardOutLogger from all channels
16:30:13.828 INFO  [first-akka.actor.default-dispatcher-2] akka.actor.ActorSystemImpl - REMOTE: RemoteServerStarted@akka://fi...@127.0.0.1:2552
16:30:13.830 DEBUG [first-akka.actor.default-dispatcher-2] akka.event.EventStream - subscribing Actor[akka://first/system/RemoteClientLifeCycleListener] to channel interface akka.remote.RemoteLifeCycleEvent
16:30:13.832 DEBUG [first-akka.actor.default-dispatcher-1] a.a.LocalActorRefProvider$SystemGuardian - now supervising Actor[akka://first/system/RemoteClientLifeCycleListener]
16:30:13.855 DEBUG [first-akka.actor.default-dispatcher-3] a.r.RemoteActorRefProvider$$anonfun$1$$anon$1 - started (akka.remote.RemoteActorRefProvider$$anonfun$1$$anon$1@10e155fb)
16:30:14.051 INFO  [last-akka.actor.default-dispatcher-3] akka.event.slf4j.Slf4jEventHandler - Slf4jEventHandler started
16:30:14.053 DEBUG [last-akka.actor.default-dispatcher-3] akka.event.EventStream - logger log1-Slf4jEventHandler started
16:30:14.054 DEBUG [last-akka.actor.default-dispatcher-3] akka.event.EventStream - Default Loggers started
16:30:14.054 DEBUG [last-akka.actor.default-dispatcher-3] akka.event.EventStream - unsubscribing StandardOutLogger from all channels
16:30:14.075 INFO  [last-akka.actor.default-dispatcher-3] akka.actor.ActorSystemImpl - REMOTE: RemoteServerStarted@akka://la...@127.0.0.1:2552
16:30:14.076 DEBUG [last-akka.actor.default-dispatcher-3] a.r.RemoteActorRefProvider$$anonfun$1$$anon$1 - started (akka.remote.RemoteActorRefProvider$$anonfun$1$$anon$1@66edadfa)
16:30:14.077 DEBUG [last-akka.actor.default-dispatcher-3] a.a.LocalActorRefProvider$SystemGuardian - now supervising Actor[akka://last/system/RemoteClientLifeCycleListener]
16:30:14.077 DEBUG [last-akka.actor.default-dispatcher-3] akka.event.EventStream - subscribing Actor[akka://last/system/RemoteClientLifeCycleListener] to channel interface akka.remote.RemoteLifeCycleEvent
16:30:14.083 DEBUG [last-akka.actor.default-dispatcher-3] a.a.LocalActorRefProvider$Guardian - now supervising Actor[akka://last/user/test]
16:30:14.085 DEBUG [first-akka.actor.default-dispatcher-1] a.a.LocalActorRefProvider$Guardian - now supervising Actor[akka://first/user/test]
16:30:14.088 DEBUG [first-akka.actor.default-dispatcher-3] c.t.chargenetwork.server.LogActor - started (com.thenewmotion.chargenetwork.server.LogActor@1cbbddb2)
16:30:14.089 DEBUG [last-akka.actor.default-dispatcher-2] c.t.chargenetwork.server.LogActor - started (com.thenewmotion.chargenetwork.server.LogActor@12036483)
16:30:22.374 INFO  [first-akka.actor.default-dispatcher-2] akka.actor.ActorSystemImpl - REMOTE: RemoteClientStarted@akka://def...@127.0.0.1:2553
16:30:22.375 DEBUG [first-akka.actor.default-dispatcher-2] RemoteClient(akka://first) - Starting remote client connection to [akka://def...@127.0.0.1:2553]
16:30:22.381 DEBUG [first-akka.actor.default-dispatcher-4] akka.actor.ActorSystemImpl - REMOTE: RemoteServerClientConnected@akka://fi...@127.0.0.1:2552: Client[akka://def...@127.0.0.1:2553]
16:30:22.414 ERROR [first-akka.actor.default-dispatcher-4] NettyRemoteTransport(null) - dropping message last for non-local recipient akka://la...@127.0.0.1:2552/user/test at akka://fi...@127.0.0.1:2552 local is akka://fi...@127.0.0.1:2552
16:30:22.472 INFO  [first-akka.actor.default-dispatcher-4] akka.actor.ActorSystemImpl - REMOTE: RemoteClientStarted@akka://def...@127.0.0.1:2553
16:30:22.473 DEBUG [first-akka.actor.default-dispatcher-4] RemoteClient(akka://first) - Starting remote client connection to [akka://def...@127.0.0.1:2553]
16:30:22.475 DEBUG [first-akka.actor.default-dispatcher-4] RemoteClient(akka://first) - Shutting down remote client [PassiveRemoteClient@akka://def...@127.0.0.1:2553]
16:30:22.478 INFO  [first-akka.actor.default-dispatcher-4] akka.actor.ActorSystemImpl - REMOTE: RemoteClientShutdown@akka://def...@127.0.0.1:2553
16:30:22.478 DEBUG [first-akka.actor.default-dispatcher-4] RemoteClient(akka://first) - [PassiveRemoteClient@akka://def...@127.0.0.1:2553] has been shut down
16:30:22.478 DEBUG [first-akka.actor.default-dispatcher-4] akka.actor.ActorSystemImpl - REMOTE: RemoteServerClientConnected@akka://fi...@127.0.0.1:2552: Client[akka://def...@127.0.0.1:2553]
first
To view this discussion on the web visit https://groups.google.com/d/msg/akka-user/-/AOS6A3-DkCQJ.

To post to this group, send email to akka...@googlegroups.com.
To unsubscribe from this group, send email to akka-user+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/akka-user?hl=en.

Yaroslav Klymko

unread,
Jun 1, 2012, 9:51:44 AM6/1/12
to akka...@googlegroups.com
Why don't take my code and run it? 
And not forget to have different application.conf 


object TestServer extends App {
  val first = ActorSystem("first")
  val last = ActorSystem("last")
  last.actorOf(Props(new LogActor), "test")
  first.actorOf(Props(new LogActor), "test")
}
class LogActor extends Actor {
  protected def receive = {
    case x => println(x)
  }
}

akka {
  event-handlers = ["akka.event.slf4j.Slf4jEventHandler"]
  http{
    system-name = chargenetwork
    timeout = 1000
    endpoint-retrieval-timeout = 300
  }
  actor {
    provider = "akka.remote.RemoteActorRefProvider"
  }
  remote {

      netty {
        hostname = "127.0.0.1"
        port = 2552
      }
   }

object TestClient extends App {
  ActorSystem().actorFor("akka://la...@127.0.0.1:2552/user/test") ! "last"
  ActorSystem().actorFor("akka://fi...@127.0.0.1:2552/user/test") ! "first"
}


akka {
  event-handlers = ["akka.event.slf4j.Slf4jEventHandler"]

  actor {
    provider = "akka.remote.RemoteActorRefProvider"
  }

  remote {
    netty {
      hostname = "127.0.0.1"
      port = 2553
Yaroslav Klymko  |  Software Engineer 
t3h...@gmail.com  |  t3hnar Skype status Facebook Twitter LinkedIn foursquare 
Mobile: +38 (068) 500-9777

Patrik Nordwall

unread,
Jun 1, 2012, 9:58:17 AM6/1/12
to akka...@googlegroups.com
What I can see is that you start on 2552 and 2553, but client is only using 2552

  ActorSystem().actorFor("akka://la...@127.0.0.1:2552/user/test") ! "last"
  ActorSystem().actorFor("akka://fi...@127.0.0.1:2552/user/test") ! "first"

Patrik Nordwall

Typesafe The software stack for applications that scale

Twitter: @patriknw


√iktor Ҡlang

unread,
Jun 1, 2012, 9:58:59 AM6/1/12
to akka...@googlegroups.com
On Fri, Jun 1, 2012 at 3:51 PM, Yaroslav Klymko <t3h...@gmail.com> wrote:
Why don't take my code and run it? 

Simply because I do not have time.

If someone else has time, please feel free to try it out. But I think you have a better chance if you package it in something that require less manual work to try it out.
I strongly recommend against not passing in config to your ActorSystem if you're running multiple since they are going to get the same config.

Also, why do you create 2 ActorSystems just to do actorFor (as well as omitting system name for them)?

Cheers,

√iktor Ҡlang

unread,
Jun 1, 2012, 10:22:28 AM6/1/12
to akka...@googlegroups.com


On Fri, Jun 1, 2012 at 4:04 PM, Yaroslav Klymko <t3h...@gmail.com> wrote:
2 ActorSystems were created by mistake in different scopes which was not obvious and no errors about that...
However I spent a lot of time to find out why remote messaging doesn't work...

How about you opening up 2 REPLs and start _1_ server in the first and 1 client in the other and take it from there?
 
Further I'm not going to create 2 systems. However it doesn't mean there is no bug :)


I'm still unconvinced, the unit tests pass ;-)

Cheers,

 
      }
    }
}
 

Sorry man, cannot reproduce:

[INFO] [06/01/2012 15:47:00.203] [run-main] [ActorSystem(bar)] RemoteServerStarted@akka://bar@127.0.0.1:2552
Cheers,

16:30:13.828 INFO  [first-akka.actor.default-dispatcher-2] akka.actor.ActorSystemImpl - REMOTE: RemoteServerStarted@akka://firs...@127.0.0.1:2552
16:30:13.830 DEBUG [first-akka.actor.default-dispatcher-2] akka.event.EventStream - subscribing Actor[akka://first/system/RemoteClientLifeCycleListener] to channel interface akka.remote.RemoteLifeCycleEvent
16:30:13.832 DEBUG [first-akka.actor.default-dispatcher-1] a.a.LocalActorRefProvider$SystemGuardian - now supervising Actor[akka://first/system/RemoteClientLifeCycleListener]
16:30:13.855 DEBUG [first-akka.actor.default-dispatcher-3] a.r.RemoteActorRefProvider$$anonfun$1$$anon$1 - started (akka.remote.RemoteActorRefProvider$$anonfun$1$$anon$1@10e155fb)
16:30:14.051 INFO  [last-akka.actor.default-dispatcher-3] akka.event.slf4j.Slf4jEventHandler - Slf4jEventHandler started
16:30:14.053 DEBUG [last-akka.actor.default-dispatcher-3] akka.event.EventStream - logger log1-Slf4jEventHandler started
16:30:14.054 DEBUG [last-akka.actor.default-dispatcher-3] akka.event.EventStream - Default Loggers started
16:30:14.054 DEBUG [last-akka.actor.default-dispatcher-3] akka.event.EventStream - unsubscribing StandardOutLogger from all channels
16:30:14.075 INFO  [last-akka.actor.default-dispatcher-3] akka.actor.ActorSystemImpl - REMOTE: RemoteServerStarted@akka://last...@127.0.0.1:2552
16:30:14.076 DEBUG [last-akka.actor.default-dispatcher-3] a.r.RemoteActorRefProvider$$anonfun$1$$anon$1 - started (akka.remote.RemoteActorRefProvider$$anonfun$1$$anon$1@66edadfa)
16:30:14.077 DEBUG [last-akka.actor.default-dispatcher-3] a.a.LocalActorRefProvider$SystemGuardian - now supervising Actor[akka://last/system/RemoteClientLifeCycleListener]
16:30:14.077 DEBUG [last-akka.actor.default-dispatcher-3] akka.event.EventStream - subscribing Actor[akka://last/system/RemoteClientLifeCycleListener] to channel interface akka.remote.RemoteLifeCycleEvent
16:30:14.083 DEBUG [last-akka.actor.default-dispatcher-3] a.a.LocalActorRefProvider$Guardian - now supervising Actor[akka://last/user/test]
16:30:14.085 DEBUG [first-akka.actor.default-dispatcher-1] a.a.LocalActorRefProvider$Guardian - now supervising Actor[akka://first/user/test]
16:30:14.088 DEBUG [first-akka.actor.default-dispatcher-3] c.t.chargenetwork.server.LogActor - started (com.thenewmotion.chargenetwork.server.LogActor@1cbbddb2)
16:30:14.089 DEBUG [last-akka.actor.default-dispatcher-2] c.t.chargenetwork.server.LogActor - started (com.thenewmotion.chargenetwork.server.LogActor@12036483)
16:30:22.374 INFO  [first-akka.actor.default-dispatcher-2] akka.actor.ActorSystemImpl - REMOTE: RemoteClientStarted@akka://defau...@127.0.0.1:2553
16:30:22.375 DEBUG [first-akka.actor.default-dispatcher-2] RemoteClient(akka://first) - Starting remote client connection to [akka://def...@127.0.0.1:2553]
16:30:22.381 DEBUG [first-akka.actor.default-dispatcher-4] akka.actor.ActorSystemImpl - REMOTE: RemoteServerClientConnected@akka://fi...@127.0.0.1:2552: Client[akka://def...@127.0.0.1:2553]
16:30:22.414 ERROR [first-akka.actor.default-dispatcher-4] NettyRemoteTransport(null) - dropping message last for non-local recipient akka://la...@127.0.0.1:2552/user/test at akka://fi...@127.0.0.1:2552 local is akka://fi...@127.0.0.1:2552
16:30:22.472 INFO  [first-akka.actor.default-dispatcher-4] akka.actor.ActorSystemImpl - REMOTE: RemoteClientStarted@akka://defau...@127.0.0.1:2553
16:30:22.473 DEBUG [first-akka.actor.default-dispatcher-4] RemoteClient(akka://first) - Starting remote client connection to [akka://def...@127.0.0.1:2553]
16:30:22.475 DEBUG [first-akka.actor.default-dispatcher-4] RemoteClient(akka://first) - Shutting down remote client [PassiveRemoteClient@akka://defa...@127.0.0.1:2553]
16:30:22.478 INFO  [first-akka.actor.default-dispatcher-4] akka.actor.ActorSystemImpl - REMOTE: RemoteClientShutdown@akka://defa...@127.0.0.1:2553
16:30:22.478 DEBUG [first-akka.actor.default-dispatcher-4] RemoteClient(akka://first) - [PassiveRemoteClient@akka://defa...@127.0.0.1:2553] has been shut down



--
Yaroslav Klymko  |  Software Engineer 
t3h...@gmail.com  |  t3hnar Skype status Facebook Twitter LinkedIn foursquare 
Mobile: +38 (068) 500-9777

--
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To post to this group, send email to akka...@googlegroups.com.
To unsubscribe from this group, send email to akka-user+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/akka-user?hl=en.



--
Viktor Klang

Akka Tech Lead
Typesafe - The software stack for applications that scale

Twitter: @viktorklang

--
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To view this discussion on the web visit https://groups.google.com/d/msg/akka-user/-/QonjBtzUm6sJ.

To post to this group, send email to akka...@googlegroups.com.
To unsubscribe from this group, send email to akka-user+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/akka-user?hl=en.
Reply all
Reply to author
Forward
0 new messages