mirror of
https://github.com/Telecominfraproject/wlan-cloud-lib-cppkafka.git
synced 2025-11-01 19:18:04 +00:00
Allow getting config options and add multiple overloads for set
This commit is contained in:
@@ -5,17 +5,20 @@
|
||||
#include <functional>
|
||||
#include <librdkafka/rdkafka.h>
|
||||
#include "clonable_ptr.h"
|
||||
#include "configuration_base.h"
|
||||
|
||||
namespace cppkafka {
|
||||
|
||||
class Topic;
|
||||
class Buffer;
|
||||
|
||||
class TopicConfiguration {
|
||||
class TopicConfiguration : public ConfigurationBase<TopicConfiguration> {
|
||||
public:
|
||||
using PartitionerCallback = std::function<int32_t(const Topic&, const Buffer& key,
|
||||
int32_t partition_count)>;
|
||||
|
||||
using ConfigurationBase<TopicConfiguration>::set;
|
||||
|
||||
TopicConfiguration();
|
||||
|
||||
void set(const std::string& name, const std::string& value);
|
||||
@@ -26,6 +29,7 @@ public:
|
||||
|
||||
const PartitionerCallback& get_partitioner_callback() const;
|
||||
rd_kafka_topic_conf_t* get_handle() const;
|
||||
std::string get(const std::string& name) const;
|
||||
private:
|
||||
using HandlePtr = ClonablePtr<rd_kafka_topic_conf_t,
|
||||
decltype(&rd_kafka_topic_conf_destroy),
|
||||
|
||||
Reference in New Issue
Block a user