/// <summary> /// Create settings from the default configuration 'akka.cluster.client'. /// </summary> /// <param name="system">TBD</param> /// <exception cref="ArgumentException">TBD</exception> /// <returns>TBD</returns> public static ClusterClientSettings Create(ActorSystem system) { system.Settings.InjectTopLevelFallback(ClusterClientReceptionist.DefaultConfig()); var config = system.Settings.Config.GetConfig("akka.cluster.client"); if (config.IsNullOrEmpty()) { throw ConfigurationException.NullOrEmptyConfig <ClusterClientSettings>("akka.cluster.client");//($"Failed to create {nameof(ClusterClientSettings)}: Actor system [{system.Name}] doesn't have `akka.cluster.client` config set up"); } return(Create(config)); }
/// <summary> /// Create settings from the default configuration "akka.cluster.client.receptionist". /// </summary> /// <param name="system">TBD</param> /// <exception cref="ArgumentException">TBD</exception> /// <returns>TBD</returns> public static ClusterReceptionistSettings Create(ActorSystem system) { system.Settings.InjectTopLevelFallback(ClusterClientReceptionist.DefaultConfig()); var config = system.Settings.Config.GetConfig("akka.cluster.client.receptionist"); if (config.IsNullOrEmpty()) { throw ConfigurationException.NullOrEmptyConfig <ClusterReceptionistSettings>("akka.cluster.client.receptionist"); } return(Create(config)); }
/// <summary> /// Create settings from the default configuration 'akka.cluster.client'. /// </summary> /// <param name="system">TBD</param> /// <exception cref="ArgumentException">TBD</exception> /// <returns>TBD</returns> public static ClusterClientSettings Create(ActorSystem system) { system.Settings.InjectTopLevelFallback(ClusterClientReceptionist.DefaultConfig()); var config = system.Settings.Config.GetConfig("akka.cluster.client"); if (config == null) { throw new ArgumentException($"Actor system [{system.Name}] doesn't have `akka.cluster.client` config set up"); } return(Create(config)); }
public static ClusterClientSettings Create(ActorSystem system) { system.Settings.InjectTopLevelFallback(ClusterClientReceptionist.DefaultConfig()); var config = system.Settings.Config.GetConfig("akka.cluster.client"); if (config == null) { throw new ArgumentException(string.Format("Actor system [{0}] doesn't have `akka.cluster.client` config set up", system.Name)); } var initialContacts = config.GetStringList("initial-contacts").Select(ActorPath.Parse).ToImmutableSortedSet(); return(new ClusterClientSettings(initialContacts, config.GetTimeSpan("establishing-get-contacts-interval"), config.GetTimeSpan("refresh-contacts-interval"), config.GetTimeSpan("heartbeat-interval"), config.GetTimeSpan("acceptable-heartbeat-pause"), config.GetInt("buffer-size"))); }