5#include <userver/engine/task/task_processor_fwd.hpp>
6#include <userver/engine/task/task_with_result.hpp>
7#include <userver/kafka/exceptions.hpp>
8#include <userver/utils/fast_pimpl.hpp>
9#include <userver/utils/statistics/writer.hpp>
11USERVER_NAMESPACE_BEGIN
20struct ProducerConfiguration;
53 engine::TaskProcessor& producer_task_processor,
54 const impl::ProducerConfiguration& configuration,
55 const impl::Secret& secrets);
63 Producer(
const Producer&) =
delete;
64 Producer(Producer&&) =
delete;
66 Producer& operator=(
const Producer&) =
delete;
67 Producer& operator=(Producer&&) =
delete;
92 void Send(
const std::string& topic_name, std::string_view key,
93 std::string_view message,
94 std::optional<std::uint32_t> partition =
std::
nullopt)
const;
106 std::string topic_name, std::string key, std::string message,
107 std::optional<std::uint32_t> partition =
std::
nullopt)
const;
112 void DumpMetric(utils::statistics::Writer& writer)
const;
115 void SendImpl(
const std::string& topic_name, std::string_view key,
116 std::string_view message,
117 std::optional<std::uint32_t> partition)
const;
120 const std::string name_;
121 engine::TaskProcessor& producer_task_processor_;
123 static constexpr std::size_t kImplSize{944};
124 static constexpr std::size_t kImplAlign{16};
125 utils::FastPimpl<impl::ProducerImpl, kImplSize, kImplAlign> producer_;