예제 #1
0
        public IActionResult GetConsumerTotalLag(string clusterId, string topicId, string consumerId)
        {
            using (var topic = _configuration.BuildTopicConsumerWrapper(clusterId, topicId, consumerId))
            {
                if (topic == null)
                {
                    return(NotFound());
                }

                var totalCommit    = topic.GetTotalCommitted();
                var totalMaxOffets = topic.GetTotalHighOffsets();

                var result = totalMaxOffets - totalCommit;
                return(Ok(result));
            }
        }
 public KafkaCommitMonitor(KafkaClusterConfigCollection configuration)
 {
     _configuration   = configuration;
     _consumerWrapper = _configuration.BuildTopicConsumerWrapper("s1", "__consumer_offsets",
                                                                 "consumer-" + Guid.NewGuid().ToString("N"));
 }