Пример #1
0
        /// <summary>
        /// Creates cluster publish/subscribe settings from the default configuration `akka.cluster.pub-sub`.
        /// </summary>
        public static DistributedPubSubSettings Create(ActorSystem system)
        {
            system.Settings.InjectTopLevelFallback(DistributedPubSub.DefaultConfig());
            var config = system.Settings.Config.GetConfig("akka.cluster.pub-sub");

            if (config == null)
            {
                throw new ArgumentException("Actor system settings has no configuration for akka.cluster.pub-sub defined");
            }

            return(Create(config));
        }
        /// <summary>
        /// Creates cluster publish/subscribe settings from the default configuration `akka.cluster.pub-sub`.
        /// </summary>
        /// <param name="system">TBD</param>
        /// <exception cref="ArgumentException">TBD</exception>
        /// <returns>TBD</returns>
        public static DistributedPubSubSettings Create(ActorSystem system)
        {
            system.Settings.InjectTopLevelFallback(DistributedPubSub.DefaultConfig());

            var config = system.Settings.Config.GetConfig("akka.cluster.pub-sub");

            if (config.IsNullOrEmpty())
            {
                throw ConfigurationException.NullOrEmptyConfig <DistributedPubSubSettings>("akka.cluster.pub-sub");
            }

            return(Create(config));
        }