Пример #1
0
        private async Task And_a_single_topic()
        {
            _topicName = "Integration-test-" + Guid.NewGuid();
            var topicCreate = TopicCreate.Create(
                name: _topicName,
                partitionCount: 1
                );

            await _client.Topics.CreateAsync(topicCreate);
        }
Пример #2
0
        private async Task When_a_topic_with_the_same_name_is_added()
        {
            var topicCreate = TopicCreate.Create(
                name: _topicName,
                partitionCount: 1
                );


            await _client.Topics.CreateAsync(topicCreate);
        }
Пример #3
0
        private async Task And_a_single_topic()
        {
            using var client    = LocalhostRestClient.Create();
            _topicCreateCommand = TopicCreate.Create(
                name: Guid.NewGuid().ToString(),
                partitionCount: 1
                );

            await client.Topics.CreateAsync(_topicCreateCommand);
        }
        public async Task Add(Topic topic)
        {
            var topicCreate = TopicCreate.Create(topic.Name, topic.Partitions);

            foreach (var(key, value) in topic.Configurations)
            {
                var jsonElement = (JsonElement)value;
                topicCreate = topicCreate.WithConfiguration(key, JsonObjectTools.GetValueFromJsonElement(jsonElement));
            }
            await _tikaClient.Topics.CreateAsync(topicCreate);
        }
        private async Task And_a_single_topic()
        {
            using var client = LocalhostRestClient.Create();
            _topicName       = Guid.NewGuid().ToString();
            var topicCreate = TopicCreate.Create(
                name: _topicName,
                partitionCount: 1
                );

            await client.Topics.CreateAsync(topicCreate);
        }
Пример #6
0
        private async Task Then_a_topic_is_created(Topic topic)
        {
            var topicCreate = TopicCreate.Create(topic.Name, topic.Partitions);

            if (topic.Configurations != null)
            {
                foreach (var(key, value) in topic.Configurations)
                {
                    topicCreate = topicCreate.WithConfiguration(key, value);
                }
            }

            await _tikaClient.Topics.CreateAsync(topicCreate);
        }
Пример #7
0
        private async Task When_a_topic_with_the_same_name_but_different_partitions_is_added()
        {
            try
            {
                var topicCreate = TopicCreate.Create(
                    name: _topicName,
                    partitionCount: 2
                    );


                await _client.Topics.CreateAsync(topicCreate);
            }
            catch (TopicAlreadyExistsException e)
            {
                _topicAlreadyExistsException = e;
            }
        }
Пример #8
0
        private async Task When_creating_a_topic_with_configuration()
        {
            _topicName = "Integration-test-" + Guid.NewGuid();
            var random = new Random();

            _messageRetentionPeriod = TimeSpan.FromDays(random.Next(1, 7));
            _maxDiskUsageInBytes    = random.Next(1, 2001) * 1000000;

            var topicCreate = TopicCreate
                              .Create(
                name: _topicName,
                partitionCount: 1)
                              .WithConfiguration("retention.ms", _messageRetentionPeriod.TotalMilliseconds)
                              .WithConfiguration("retention.bytes", _maxDiskUsageInBytes);

            await _client.Topics.CreateAsync(topicCreate);
        }
Пример #9
0
 private async Task When_a_topic_creation_is_requested()
 {
     var topicCreate = TopicCreate.Create("devex-integrationtest", 3);
     await _tikaRestClient.Topics.CreateAsync(topicCreate);
 }