static async Task Main(params string[] args) { var options = new ClusterizatorOptions(args); var logger = new ConsoleLogger(); var pricesRepository = new PriceProjectionRepository(options.MongoServer, options.MongoDatabase, options.Category); var pricesProducer = new KafkaProducerBase <string, ProductPriceProjection>(logger, options.Broker, options.OutputTopic, 3, true); var clusterizator = new PriceClusterizator(pricesRepository, pricesProducer, logger); var consumer = new ClusterizationConsumer(clusterizator, logger, options.Broker, options.ClusterizatorsConsumerGroup, $"{options.InputTopicPrefix}.{options.Category}"); await consumer.Run(); }
public ClusterizationConsumer(PriceClusterizator clusterizator, ILogger logger, string broker, string consumerGroup, string topic) : base(logger, broker, consumerGroup, topic, false) { _clusterizator = clusterizator; }