Exemplo n.º 1
0
 public TopicMetadata GetMetadata()
 {
     return(_zkConnect.CreateSimpleManager()
            .RefreshMetadata(
                KafkaConfig.VersionId,
                KafkaConfig.ClientId,
                KafkaConfig.NextCorrelationId(),
                _name,
                false));
 }
Exemplo n.º 2
0
        public KafkaSimpleConsumerStream(IZookeeperConnection zkConnect, string topicName, int partition, long offset)
        {
            _topicName = topicName;
            _partition = partition;
            _manager   = zkConnect.CreateSimpleManager();

            _manager.RefreshMetadata(
                KafkaConfig.VersionId,
                KafkaConfig.ClientId,
                KafkaConfig.NextCorrelationId(),
                _topicName,
                true);

            _consumer = _manager.GetConsumer(topicName, partition);

            _thread = new Thread(RunConsumer);

            _nextOffset = offset;
        }