示例#1
0
        public void Dispose()
        {
            _innerConsumer?.Close();
            _innerConsumer?.Dispose();

            _innerConsumer = null;
        }
示例#2
0
 /// <summary>
 /// Kafka event consumer constructor.
 /// </summary>
 /// <param name="consumer">Kafka consumer.</param>
 /// <param name="logger">Logger.</param>
 public KafkaEventConsumer(Confluent.Kafka.IConsumer <TKey, TValue> consumer, ILogger logger = null)
 {
     this.consumer = consumer;
     this.logger   = logger;
 }
示例#3
0
 public InnerConsumerWrapper(Confluent.Kafka.ConsumerConfig config, CancellationToken cancellationToken, ILogger logger)
 {
     _innerConsumer     = BuildConfluentConsumer(config);
     _cancellationToken = cancellationToken;
     _logger            = logger;
 }
示例#4
0
 private void InitInnerConsumer()
 {
     _innerConsumer = BuildConfluentConsumer();
     Subscribe();
 }
示例#5
0
 private void DisposeInnerConsumer()
 {
     _innerConsumer?.Close();
     _innerConsumer?.Dispose();
     _innerConsumer = null;
 }