Ejemplo n.º 1
0
        public AkkaServer(int port)
        {
            _system           = ActorSystem.Create(SystemConfigurationHelper.ClusterName, SystemConfigurationHelper.GetConfig(port, Role));
            _automaticCluster = new AutomaticCluster(_system);
            _automaticCluster.Join();

            var sharding    = ClusterSharding.Get(_system);
            var shardRegion = sharding.Start(
                typeName: "stuffer",
                entityProps: Props.Create <PersistentStuffActor>(),
                settings: ClusterShardingSettings.Create(_system).WithRole(Role),
                messageExtractor: GetMessageExtractor());
        }
Ejemplo n.º 2
0
 public AkkaClient()
 {
     _system           = ActorSystem.Create(SystemConfigurationHelper.ClusterName, SystemConfigurationHelper.GetConfig(0, Role));
     _automaticCluster = new AutomaticCluster(_system);
     _automaticCluster.Join();
     TargetServer = ClusterSharding.Get(_system).StartProxy(
         typeName: "stuffer",
         role: null,
         messageExtractor: GetMessageExtractor());
 }