8#include <userver/kafka/impl/broker_secrets.hpp>
9#include <userver/kafka/impl/configuration.hpp>
10#include <userver/kafka/impl/consumer.hpp>
11#include <userver/kafka/producer.hpp>
12#include <userver/utest/utest.hpp>
13#include <userver/utils/span.hpp>
15USERVER_NAMESPACE_BEGIN
17namespace kafka::utest {
26 std::optional<std::uint32_t> partition;
67 ~KafkaCluster() override =
default;
69 std::string GenerateTopic();
71 std::vector<std::string> GenerateTopics(std::size_t count);
73 impl::Configuration MakeProducerConfiguration(
74 const std::string& name,
75 impl::ProducerConfiguration configuration = {},
76 impl::Secret secrets = {}
79 impl::Configuration MakeConsumerConfiguration(
80 const std::string& name,
81 impl::ConsumerConfiguration configuration = {},
82 impl::Secret secrets = {}
85 Producer MakeProducer(
const std::string& name, impl::ProducerConfiguration configuration = {});
87 std::deque<Producer> MakeProducers(
89 std::function<std::string(std::size_t)> nameGenerator,
90 impl::ProducerConfiguration configuration = {}
96 impl::Consumer MakeConsumer(
97 const std::string& name,
98 const std::vector<std::string>& topics,
99 impl::ConsumerConfiguration configuration = {},
100 impl::ConsumerExecutionParams params = {}
113 impl::Secret AddBootstrapServers(impl::Secret secrets)
const;
116 std::atomic<std::size_t> topics_count_{0};
118 const std::string bootstrap_servers_;