private void ThrowIfNotValid(PersistedSubscriberParameters subscriberParameters) { ThrowIfNotValid((SubscriberParameters)subscriberParameters); if (EventsStoreType.Undefined == subscriberParameters.EventsStoreType) { throw new NotSupportedException("Undefined is not supported for persisted events store."); } }
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)); }
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)); }
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)); }