private void ValidateConfiguration() { var exceptions = new List<Exception>(); if (Logger == null) Logger = new NullLogger(); if (Serializer == null) exceptions.Add(new InvalidConfigurationException("A serializer must be set!")); if (Compressor == null) Compressor = new NullCompressor(); if (CommandPipeline == null && EventPipeline == null && RequestResponsePipeline == null) exceptions.Add(new InvalidConfigurationException("No pipelines are configured! One or more of the following are needed: CommandPipeline, EventPipeline and RequestResponsePipeline")); if (CommandPipeline == null) CommandPipeline = new CommandPipelineConfiguration(); if (EventPipeline == null) EventPipeline = new EventPipelineConfiguration(); if (RequestResponsePipeline != null) RequestResponsePipeline = new RequestResponsePipelineConfiguration(); if (exceptions.Any()) throw new AggregateException(exceptions); }
/// <summary> /// Used when configuring a EventPipeline to be used with Cumulus /// </summary> /// <param name="configuration"></param> /// <param name="configure"></param> /// <returns></returns> public static Config WithEventPipeline(this Config configuration, Action<EventPipelineConfiguration> configure = null) { var config = new EventPipelineConfiguration(); configure?.Invoke(config); configuration.EventPipeline = config; return configuration; }
public EventPipelineConfigurationTests() { _config = new EventPipelineConfiguration(); }