public KafkaClient( IOptions <ProducerConfig> producerConfig, IOptions <ConsumerConfig> consumerConfig, IOptions <RayKafkaOptions> options, ISerializer serializer) { producerObjectPool = new DefaultObjectPool <PooledProducer>(new ProducerPooledObjectPolicy(producerConfig.Value), options.Value.ProducerMaxPoolSize); this.consumerConfig = consumerConfig.Value; this.serializer = serializer; rayKafkaOptions = options.Value; }
public KafkaClient( IOptions <ProducerConfig> producerConfig, IOptions <ConsumerConfig> consumerConfig, IOptions <RayKafkaOptions> options, ILogger <KafkaClient> logger, ISerializer serializer) { producerObjectPool = new DefaultObjectPool <PooledProducer>(new ProducerPooledObjectPolicy(producerConfig.Value, logger), options.Value.ProducerMaxPoolSize); this.consumerConfig = consumerConfig.Value; this.consumerConfig.EnableAutoCommit = false; this.consumerConfig.AutoOffsetReset = AutoOffsetReset.Earliest; this.consumerConfig.EnablePartitionEof = true; this.serializer = serializer; rayKafkaOptions = options.Value; this.logger = logger; }