/// <summary>
        /// Configures manual subscription
        /// </summary>
        /// <param name="subscription"></param>
        protected void ConfigureManualSubscription(IManualSubscription subscription)
        {
            switch (subscription)
            {
            case Assignment assignment:
                ConsumerActor.Tell(new KafkaConsumerActorMetadata.Internal.Assign(assignment.TopicPartitions), SourceActor.Ref);
                TopicPartitions = TopicPartitions.Union(assignment.TopicPartitions);
                break;

            case AssignmentWithOffset assignmentWithOffset:
                ConsumerActor.Tell(new KafkaConsumerActorMetadata.Internal.AssignWithOffset(assignmentWithOffset.TopicPartitions), SourceActor.Ref);
                TopicPartitions = TopicPartitions.Union(assignmentWithOffset.TopicPartitions.Select(tp => tp.TopicPartition));
                break;
            }
        }
Beispiel #2
0
        public void Parse()
        {
            GroupId = _data.GetString();
            var topics_size = _data.GetInt();

            for (var i = 0; i < topics_size; i++)
            {
                var topicPartition = new TopicPartitions
                {
                    Topic = _data.GetString()
                };
                var partition_size = _data.GetInt();
                for (var j = 0; j < partition_size; j++)
                {
                    var partition = _data.GetInt();
                    topicPartition.Partitions.Add(partition);
                }
                TopicPartitionsList.Add(topicPartition);
            }
        }