0

I'm learning Akka.net. I've set up a running test where I'm running an actor locally, and remotely over to another actor on a VM in Azure.

The problem is, after I'm done and close the application locally the remote actor also goes down.

"An existing connection was forcibly closed by the remote host"

What I need the remote actor to is just to accept the termination, and wait for the next connection from the actor running locally. How can I fix this?

Jason94
  • 13,320
  • 37
  • 106
  • 184

2 Answers2

2

If you're creating actors using remote deployment, then actor will always be stopped, once it's parent will be die (due to actor system shutdown). In this case, while child is living on another machine, it's still a child of local actor. This is a natural part of actor system lifecycle - children cannot live without their parents.

If you're interested with having your actors scattered among cluster nodes and make them rebalanced/recreated automatically, you may take a look at Akka.Cluster.Sharding plugin. Keep in mind, that while a lot easier, this solution is also a more complex and slower solution than standard akka actors. Make sure you really need those features.

Bartosz Sypytkowski
  • 7,463
  • 19
  • 36
0

If you want an actor to continue to live on then you cannot use remote deployment, you should be creating a service that contains the actor and interact with it using some form of remote technology such as wcf, rest and/or web services.

If you want an actor to exist waiting for work, then I suggest that you look into a different product - try nServiceBus from Particular.net, we use it this way and are very happy with it. It is essentially the actor model listening to a persistent queue.

Karell Ste-Marie
  • 1,022
  • 1
  • 10
  • 22