Beispiel #1
0
 public KafkaPublisher(KafkaOptions kafkaOptions
                       , ILogger <KafkaPublisher> logger)
 {
     _kafkaOptions = kafkaOptions;
     _logger       = logger;
     _producer     = new ProducerBuilder <Null, String>(_kafkaOptions.AsKafkaConfig()).Build();
 }
Beispiel #2
0
 public KafkaPublisher(KafkaOptions kafkaOptions
                       , ILogger <KafkaPublisher> logger)
 {
     _kafkaOptions = kafkaOptions;
     _logger       = logger;
     _producer     = new ProducerBuilder <String, String>(_kafkaOptions.AsKafkaConfig())
                     .SetErrorHandler(OnProduceError).Build();
 }
Beispiel #3
0
 public KafkaSubscriber(KafkaOptions kafkaOptions, ILogger <KafkaSubscriber> logger)
 {
     _tokenSource  = new CancellationTokenSource();
     _kafkaOptions = kafkaOptions;
     _logger       = logger;
     _consumer     = new ConsumerBuilder <String, string>(kafkaOptions.AsKafkaConfig())
                     .SetErrorHandler(OnConsumeError)
                     .Build();
 }