internal ConsumerConfiguration Build() { if (!_namingConventions.Any()) { _namingConventions.Add(item: NamingConvention.Default); } FillConfiguration(); ValidateConfiguration(); if (_consumerScopeFactory == null) { _consumerScopeFactory = new KafkaBasedConsumerScopeFactory( configuration: _configurations, topics: _messageHandlerRegistry.GetAllSubscribedTopics(), incomingMessageFactory: _incomingMessageFactory ); } return(new ConsumerConfiguration( configuration: _configurations, messageHandlerRegistry: _messageHandlerRegistry, unitOfWorkFactory: _unitOfWorkFactory, consumerScopeFactory: _consumerScopeFactory )); }
public ConsumerConfiguration(IDictionary <string, string> configuration, MessageHandlerRegistry messageHandlerRegistry, IHandlerUnitOfWorkFactory unitOfWorkFactory, IConsumerScopeFactory consumerScopeFactory) { KafkaConfiguration = configuration; MessageHandlerRegistry = messageHandlerRegistry; UnitOfWorkFactory = unitOfWorkFactory; ConsumerScopeFactory = consumerScopeFactory; }
public Consumer( MessageHandlerRegistry messageHandlerRegistry, IHandlerUnitOfWorkFactory unitOfWorkFactory, IConsumerScopeFactory consumerScopeFactory, IUnconfiguredMessageHandlingStrategy fallbackHandler, bool isAutoCommitEnabled = false) { _localMessageDispatcher = new LocalMessageDispatcher( messageHandlerRegistry, unitOfWorkFactory, fallbackHandler); _consumerScopeFactory = consumerScopeFactory ?? throw new ArgumentNullException(nameof(consumerScopeFactory)); _isAutoCommitEnabled = isAutoCommitEnabled; }
internal void WithConsumerScopeFactory(IConsumerScopeFactory consumerScopeFactory) { _builder.WithConsumerScopeFactory(consumerScopeFactory); }
internal ConsumerConfigurationBuilder WithConsumerScopeFactory(IConsumerScopeFactory consumerScopeFactory) { _consumerScopeFactory = consumerScopeFactory; return(this); }