Brod.Consumers.ConsumerConnector.CreateMessageStreams C# (CSharp) Метод

CreateMessageStreams() публичный Метод

public CreateMessageStreams ( Int32>.Dictionary topicToStreamCount ) : List>.Dictionary
topicToStreamCount Int32>.Dictionary
Результат List>.Dictionary
        public Dictionary<String, List<ConsumerMessageStream>> CreateMessageStreams(Dictionary<String, Int32> topicToStreamCount)
        {
            ValidateTopicToStreamDictionary(topicToStreamCount);

            var result = new Dictionary<String, List<ConsumerMessageStream>>();

            foreach (var pair in topicToStreamCount)
                result[pair.Key] = BuildStreamsForTopic(pair.Key, pair.Value);

            return result;
        }

Same methods

ConsumerConnector::CreateMessageStreams ( String topic, Int32 numberOfStreams ) : List

Usage Example

Пример #1
0
        /// <summary>
        /// Open numberOfStreams streams for specified topic. Paritions will be assigned to each
        /// stream in such a way, that each stream will consume roughly the same number of partitions.
        /// </summary>
        public List <ConsumerMessageStream> OpenStreams(String topic, Int32 numberOfStreams)
        {
            var connector = new ConsumerConnector(_stateStorageDirectory, _address, _infoResponse, _context.ZmqContext);
            var streams   = connector.CreateMessageStreams(topic, numberOfStreams);

            return(streams);
        }
All Usage Examples Of Brod.Consumers.ConsumerConnector::CreateMessageStreams