These are chat archives for akkadotnet/akka.net

31st
Dec 2017
Marek Pavlu
@ipavlu
Dec 31 2017 01:22
Hi, is there any effort of porting or planning for Akka.Net for UWP / .Net Core? Thanks for info....
Bartosz Sypytkowski
@Horusiath
Dec 31 2017 08:52
@ipavlu Akka.NET already works on .NET core (since half year or so)
Vasily Kirichenko
@vasily-kirichenko
Dec 31 2017 14:40

Is it possible to specify cluster related properties of a router in code?

akka {
   actor{
      provider = cluster
      deployment {
        /api/myClusterPoolRouter {
          router = round-robin-pool # routing strategy
          nr-of-instances = 10 # max number of total routees
          cluster {
             enabled = on
             allow-local-routees = on
             use-role = crawler
             max-nr-of-instances-per-node = 1
          }
        }
      }
   }
}

I'd like to specify allow-local-routees in code.

Bartosz Sypytkowski
@Horusiath
Dec 31 2017 14:50
@vasily-kirichenko the article on routers is here - in general props.WithRouter(router) or { props with Router = Some router } in Akkling. The actual cluster routers API is available here.
Vasily Kirichenko
@vasily-kirichenko
Dec 31 2017 15:00
Yes, I found it, thanks.
another question, I'm trying to "deploy" an actor to a node. Props are defined as following:
module PongActor =
    let props() : Props<Message> =
        props (actorOf2 (fun ctx -> function
            | Ping str ->
                logInfof ctx "Got %s" str 
                ctx.Sender() <! Pong str
                ignored()
            | _ -> unhandled()
        ))
The node raises exception:
[ERROR][31-Dec-17 14:59:15][Thread 0010][remoting] Unable to find a constructor to use for type Shared.PongActor+props@11-5. A class should either have a default constructor, one constructor
with arguments or a constructor marked with the JsonConstructor attribute. Path '', line 1, position 57.
Cause: Newtonsoft.Json.JsonSerializationException: Unable to find a constructor to use for type Shared.PongActor+props@11-5. A class should either have a default constructor, one constructor
with arguments or a constructor marked with the JsonConstructor attribute. Path '', line 1, position 57.
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateNewObject(JsonReader reader, JsonObjectContract objectContract, JsonProperty containerMember, JsonProperty containerProp
erty, String id, Boolean& createdFromNonDefaultCreator)
the router is
let router = spawn system "router1" { Shared.PongActor.props() with Router = Some (upcast FromConfig.Instance) }
the config is
deployment {
                 /router1 {
                   router = round-robin-pool
                   nr-of-instances = 3 # max number of total routees
                   cluster {
                      enabled = on
                      allow-local-routees = on
                      max-nr-of-instances-per-node = 2
                   }
                 }
               }
so the actor must be a real class to be deployable?
Vasily Kirichenko
@vasily-kirichenko
Dec 31 2017 15:44
@Horusiath solved, just looked at Akkling examples:
serializers {
  hyperion = "Akka.Serialization.HyperionSerializer, Akka.Serialization.Hyperion"
}
serialization-bindings {
  "System.Object" = hyperion
}