Exemplo n.º 1
0
 public KafkaTopic(IZookeeperConnection zkConnect, string name)
 {
     _zkConnect = zkConnect;
     _name      = name;
     _zkClient  = zkConnect.CreateClient();
     _producer  = _zkClient.CreateProducer <string, KafkaMessage>();
 }
Exemplo n.º 2
0
 public KafkaTopic(IZookeeperConnection zkConnect, string name, ProducerConfig producerConfig = null)
 {
     if (producerConfig == null)
     {
         producerConfig = ProducerConfig.GetDefaultConfig();
     }
     _zkConnect = zkConnect;
     _name      = name;
     _zkClient  = zkConnect.CreateClient();
     _producer  = _zkClient.CreateProducer <string, KafkaMessage>(producerConfig);
 }