public KafkaConfiguration Build() { var configuration = new KafkaConfiguration(); configuration.AddClusters(this.clusters.Select(x => x.Build(configuration))); this.dependencyConfigurator .AddSingleton(typeof(ILogHandler), this.logHandler) .AddSingleton <IConsumerAccessor>(ConsumerManager.Instance) .AddSingleton <IConsumerManager>(ConsumerManager.Instance); return(configuration); }
public KafkaConfiguration Build() { var configuration = new KafkaConfiguration(); configuration.AddClusters(this.clusters.Select(x => x.Build(configuration))); var consumerManager = new ConsumerManager(); this.dependencyConfigurator .AddSingleton(typeof(ILogHandler), this.logHandler) .AddSingleton <IConsumerAccessor>(consumerManager) .AddSingleton <IConsumerManager>(consumerManager) .AddSingleton <IProducerAccessor>(resolver => new ProducerAccessor(resolver.ResolveAll <IMessageProducer>())); return(configuration); }