示例#1
0
 public KafkaTopic(IZookeeperConnection zkConnect, string name)
 {
     _zkConnect = zkConnect;
     _name      = name;
     _zkClient  = zkConnect.CreateClient();
     _producer  = _zkClient.CreateProducer <string, KafkaMessage>();
 }
示例#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);
 }