コード例 #1
0
        private void ThrowIfNotValid(PersistedSubscriberParameters subscriberParameters)
        {
            ThrowIfNotValid((SubscriberParameters)subscriberParameters);

            if (EventsStoreType.Undefined == subscriberParameters.EventsStoreType)
            {
                throw new NotSupportedException("Undefined is not supported for persisted events store.");
            }
        }
コード例 #2
0
        public HandlerPubSubForSyntax AddListenerToPersistedPubSub(Action <PersistedSubscriberParameters> options)
        {
            var parameter = new PersistedSubscriberParameters();

            options.Invoke(parameter);
            SetDefaultValue(parameter);
            ThrowIfNotValid(parameter);

            parameter.GroupName = String.IsNullOrWhiteSpace(parameter.GroupName) ? parameter.Identifier : parameter.GroupName;

            _services.AddSingleton <SubscriberParameters>(parameter);

            return(new HandlerPubSubForSyntax(_services, _configuration, parameter));
        }
コード例 #3
0
        public HandlerPubSubForSyntax AddListenerToPersistedPubSubByInstance(Action <PersistedSubscriberParameters> options)
        {
            var parameter = new PersistedSubscriberParameters();

            options.Invoke(parameter);
            SetDefaultValue(parameter);

            ThrowIfNotValid(parameter);

            parameter.GroupName = String.Empty;

            _services.AddSingleton <SubscriberParameters>(parameter);

            return(new HandlerPubSubForSyntax(_services, _configuration, parameter));
        }
コード例 #4
0
        public HandlerPubSubForSyntax AddListenerToPersistedPubSubByInstance(string section, Func <PolicyBuilder, RetryPolicy> customPolicy = null)
        {
            var parameter = new PersistedSubscriberParameters();

            _configuration.GetSection(section).Bind(parameter);
            SetDefaultValue(parameter);
            if (null != customPolicy)
            {
                parameter.RetryPolicy = customPolicy;
            }
            ThrowIfNotValid(parameter);

            parameter.GroupName = String.Empty;

            _services.AddSingleton <SubscriberParameters>(parameter);

            return(new HandlerPubSubForSyntax(_services, _configuration, parameter));
        }