Ejemplo n.º 1
0
        private void ReleasePartitionOwnership(IDictionary <string, IList <string> > topicThreadIdsMap)
        {
            try
            {
                Logger.Info("Will release partition ownership");

                zkConsumerConnector.ReleaseAllPartitionOwnerships();

                Logger.Info("Will clean up topicRegistry ...");
                foreach (var item in topicThreadIdsMap)
                {
                    var topic       = item.Key;
                    var removeTopic = topicRegistry.Remove(topic);
                    Logger.InfoFormat("clean up topicRegistry result for topic {0} is {1} ", topic, removeTopic);
                }
                Logger.Info("Finish clean up topicRegistry");
            }
            catch (Exception ex)
            {
                Logger.ErrorFormat("error in ReleasePartitionOwnership : {0}", ex.FormatException());
            }
            Logger.Info("Finish release partition ownership");
        }